lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Create PNP device attributes via dev_attrs field of struct device
    On Wed, Sep 24, 2008 at 10:22, Drew Moseley <dmoseley@mvista.com> wrote:
    > Kay Sievers wrote:
    >>
    >> Any reason not to assign it statically to pnp_bus_type at in
    >> drivers/pnp/driver.c?

    > Not really but since everything in the dev_attrs array is statically
    > defined in interface.c it was simpler to implement it this way. To
    > assign it in driver.c, the array can be made non-static and an extern
    > added in driver.c, or the array definition can be moved to driver.c and
    > all the set and show functions be made non-static. Is there a preference?

    Yeah, it looks weird to mangle the bus_type values from a device
    routine, and set the same value again and again with every device
    creation. Just declare the array non-static, if moving the code around
    between files does not allow a static declaration.

    Thanks,
    Kay


    \
     
     \ /
      Last update: 2008-09-24 21:05    [W:0.019 / U:87.872 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site