lkml.org 
[lkml]   [2018]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support
    From
    Date
    On Thu, 2018-04-26 at 03:34 +0100, Javier Arteaga wrote:
    > On Wed, Apr 25, 2018 at 07:15:45PM +0300, Andy Shevchenko wrote:
    > > On Sat, 2018-04-21 at 09:50 +0100, Javier Arteaga wrote:

    > > > +static int __init upboard_led_probe(struct platform_device *pdev)
    > >
    > > Are you sure about __init here?
    >
    > Not 100% now :)
    >
    > My understanding was that in this context, __init allows this probe()
    > to
    > be dropped from memory after module load.
    >
    > What am I doing wrong there?

    Just give another thought about it. The keyword(s) here is(are): time to
    live of the objects in question. It's good to get knowing what unbind-
    bind means (for built-in drivers).

    > > > + struct upboard_led_data * const pdata = pdev-
    > > > > dev.platform_data;
    > >
    > > Don't use direct dereference to platform_data.
    >
    > Sorry, I don't understand this one. What's the alternative?

    See other drivers how they do that stuff. Hint: check inline functions
    in include/linux/device.h.

    --
    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Intel Finland Oy

    \
     
     \ /
      Last update: 2018-04-26 09:56    [W:3.171 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site