From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Max Staudt <max@enpas.org>
Cc: axboe@kernel.dk, linux-ide@vger.kernel.org,
linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org,
glaubitz@physik.fu-berlin.de, schmitzmic@gmail.com,
geert@linux-m68k.org
Subject: Re: [PATCH v4] ata/pata_buddha: Probe via modalias instead of initcall
Date: Mon, 12 Aug 2019 17:01:09 +0200 [thread overview]
Message-ID: <26447daa-b183-1121-b2a8-c295d7e3468d@samsung.com> (raw)
In-Reply-To: <94b4ef23-282d-44e4-d21e-60c8a33c342c@enpas.org>
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
next prev parent reply other threads:[~2019-08-12 15:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-11 15:36 [PATCH v4] ata/pata_buddha: Probe via modalias instead of initcall Max Staudt
2019-08-11 15:40 ` Max Staudt
2019-08-11 19:28 ` Max Staudt
2019-08-12 10:42 ` Bartlomiej Zolnierkiewicz
2019-08-12 10:55 ` Max Staudt
2019-08-12 12:15 ` Bartlomiej Zolnierkiewicz
2019-08-12 14:26 ` Max Staudt
2019-08-12 15:01 ` Bartlomiej Zolnierkiewicz [this message]
2019-08-12 15:39 ` Max Staudt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26447daa-b183-1121-b2a8-c295d7e3468d@samsung.com \
--to=b.zolnierkie@samsung.com \
--cc=axboe@kernel.dk \
--cc=geert@linux-m68k.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=max@enpas.org \
--cc=schmitzmic@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).