lkml.org 
[lkml]   [2013]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 10/10] drivers: misc: use module_platform_driver_probe()
On Wed, Mar 20, 2013 at 12:46 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 20 March 2013, Fabio Porcedda wrote:
>>
>> On Wed, Mar 20, 2013 at 11:20 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Wednesday 20 March 2013, Fabio Porcedda wrote:
>> >> I think we can check inside the deferred_probe_work_func()
>> >> if the dev->probe function pointer is equal to platform_drv_probe_fail().
>> >
>> > I think it's too late by then, because that would only warn if we try to probe
>> > it again, but when platform_driver_probe() does not succeed immediately, it
>>
>> Maybe you mean "does succeed immediately" ?
>
> I mean in this code (simplified for the sake of discussion)
>
> int __init_or_module platform_driver_probe(struct platform_driver *drv,
> int (*probe)(struct platform_device *))
> {
> int retval, code;
>
> drv->probe = probe;
> retval = code = platform_driver_register(drv);
>
> drv->probe = NULL;
> if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
> retval = -ENODEV;
> drv->driver.probe = platform_drv_probe_fail;
>
> if (code != retval)
> platform_driver_unregister(drv);
> return retval;
> }
>
> we assume that all devices are bound to drivers during the call to
> platform_driver_register, and if the device list is empty afterwards,
> we unregister the driver and will never get to the deferred probing
> stage.

Thanks for the explanation, I understand now that is not that simple.

I was hoping it was easier.

Regards
--
Fabio Porcedda


\
 
 \ /
  Last update: 2013-03-21 14:42    [W:0.097 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site