From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Max Staudt <max@enpas.org>
Cc: linux-ide@vger.kernel.org,
Linux/m68k <linux-m68k@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ata/pata_buddha: Probe via modalias instead of initcall
Date: Mon, 29 Jul 2019 10:53:07 +0200 [thread overview]
Message-ID: <CAMuHMdXFW2mEg8jChA=JFt-u9NMGp9m+1FnoGe=+Pxme3O2ESg@mail.gmail.com> (raw)
In-Reply-To: <20190725102211.8526-1-max@enpas.org>
Hi Max,
On Thu, Jul 25, 2019 at 3:25 PM Max Staudt <max@enpas.org> wrote:
> Up until now, the pata_buddha driver would only check for cards on
> initcall time. Now, the kernel will call its probe function as soon
> as a compatible card is detected.
>
> Device removal remains unimplemented. A WARN_ONCE() serves as a
> reminder.
>
> v2: Rename 'zdev' to 'z' to make the patch easy to analyse with
> git diff --ignore-space-change
>
> Tested-by: Max Staudt <max@enpas.org>
> Signed-off-by: Max Staudt <max@enpas.org>
Thanks for your patch!
> --- a/drivers/ata/pata_buddha.c
> +++ b/drivers/ata/pata_buddha.c
> @@ -145,111 +146,162 @@ static struct ata_port_operations pata_xsurf_ops = {
> .set_mode = pata_buddha_set_mode,
> };
>
> -static int __init pata_buddha_init_one(void)
> +static int pata_buddha_probe(struct zorro_dev *z,
> + const struct zorro_device_id *ent)
> {
[...]
> + switch (z->id) {
> + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA:
> + default:
> + type = BOARD_BUDDHA;
> + break;
> + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL:
> + type = BOARD_CATWEASEL;
> + nr_ports++;
> + break;
> + case ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF:
> + type = BOARD_XSURF;
> + break;
> + }
Please obtain the type from ent->driver_data instead of using a switch()
statement...
> -module_init(pata_buddha_init_one);
> +static const struct zorro_device_id pata_buddha_zorro_tbl[] = {
> + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA, },
> + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL, },
> + { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, },
... after storing it in zorro_device_id.driver_data here.
> + { 0 }
> +};
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2019-07-29 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 10:22 [PATCH v2] ata/pata_buddha: Probe via modalias instead of initcall Max Staudt
[not found] ` <CGME20190725170359eucas1p271187268f749869088f60bf961194169@eucas1p2.samsung.com>
2019-07-25 17:03 ` Bartlomiej Zolnierkiewicz
2019-07-25 17:33 ` Max Staudt
2019-07-25 17:59 ` Max Staudt
2019-07-25 18:01 ` John Paul Adrian Glaubitz
2019-07-29 8:53 ` Geert Uytterhoeven [this message]
2019-07-29 10:49 ` Max
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='CAMuHMdXFW2mEg8jChA=JFt-u9NMGp9m+1FnoGe=+Pxme3O2ESg@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=max@enpas.org \
/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).