Re: [patch 2.6.19-rc6] platform_driver_probe(), can save codespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 17 November 2006 6:32 am, Dmitry Torokhov wrote:
> On 11/17/06, David Brownell <[email protected]> wrote:
> > +
> > +       /* Fixup that section violation, being paranoid about code scanning
> > +        * the list of drivers in order to probe new devices.  Check to see
> > +        * if the probe was successful, and make sure any forced probes of
> > +        * new devices fail.
> > +        */
> > +       spin_lock(&platform_bus_type.klist_drivers.k_lock);
> > +       drv->probe = NULL;
> > +       if (code == 0 && list_empty(&drv->driver.klist_devices.k_list))
> > +               retval = -ENODEV;
> > +       drv->driver.probe = platform_drv_probe_fail;
> > +       spin_unlock(&platform_bus_type.klist_drivers.k_lock);
> 
> I think this code should not be executed if driver is compiled as a
> module because __init sections will stay anyway.

Huh??  No they won't.  Are you thinking "__devinit" with CONFIG_HOTPLUG?
(Remember, this routine is not for use with hotpluggable devices.)


>	 Also, why don't you 
> also remove "bind" attribute if driver is built-in. That should save a
> bit of dynamic memory.

That would be an additional nuance.  Feel free to submit another patch
on top of this one ... :)

- Dave


> -- 
> Dmitry
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux