lkml.org 
[lkml]   [2019]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4] ata/pata_buddha: Probe via modalias instead of initcall
From
Date

On 8/12/19 4:26 PM, Max Staudt wrote:
> On 08/12/2019 02:15 PM, Bartlomiej Zolnierkiewicz wrote:
>>> What's a good way to do that, given that we now have module_exit()> defined and an exit function is void?
>>
>> What about something like this:
>>
>> static bool xsurf_present;
>> ...
>> static int __init pata_buddha_late_init(void)
>> ...
>> if (pata_buddha_probe(z, &xsurf_ent) == 0 &&
>> xsurf_present == false)
>> xsurf_present = true;
>> ...
>> static void __exit pata_buddha_exit(void)
>> ...
>> if (xsurf_present)
>> return -EBUSY;
>> ...
>>
>> ?
>
> Okay, so we're talking about the same idea. Great!
>
> Unfortunately, pata_buddha_exit() is void, and thus can't fail. According to Documentation/kernel-hacking/hacking.rst this is by design.

You are of course right and the example code is broken
(+ I need more caffeine).

> Any other ideas? We could also continue to disallow unloading completely until MFD support comes along.
Yes, this would also be OK.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

\
 
 \ /
  Last update: 2019-08-12 17:03    [W:0.083 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site