lkml.org 
[lkml]   [2019]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mbox: qcom: avoid unused-variable warning
Date
Quoting Geert Uytterhoeven (2019-09-27 12:10:13)
> On Fri, Sep 27, 2019 at 8:26 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Geert Uytterhoeven (2019-09-26 06:07:13)
> > > On Fri, Sep 20, 2019 at 11:06 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > > > Quoting Arnd Bergmann (2019-09-20 12:27:50)
> > > > > On Fri, Sep 20, 2019 at 6:45 PM Stephen Boyd <sboyd@kernel.org> wrote:
> > >
> > > > --- a/drivers/leds/leds-pca9532.c
> > > > +++ b/drivers/leds/leds-pca9532.c
> > > > @@ -472,7 +472,7 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
> > > > int i = 0;
> > > > const char *state;
> > > >
> > > > - match = of_match_device(of_pca9532_leds_match, dev);
> > > > + match = of_match_device(of_match_ptr(of_pca9532_leds_match), dev);
> > > > if (!match)
> > > > return ERR_PTR(-ENODEV);
> > >
> > > Please convert to of_device_get_match_data() instead of adding
> > > of_match_ptr() invocations...
> >
> > How is this workable? I left it as of_match_device() because the value
> > returned may be 0 for the enum and that looks the same as NULL.
>
> This function is used for the DT case only, so there will always be a match.
> Hence you can do devid = (int)(uintptr_t)of_device_get_match_data(dev).
>

Ok. Let me send out a pile of patches.

\
 
 \ /
  Last update: 2019-10-03 23:16    [W:0.099 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site