From: Michael Schmitz <schmitzmic@gmail.com>
To: Finn Thain <fthain@telegraphics.com.au>,
Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Joshua Thompson <funaho@jurai.org>,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH v2] ide/macide: Convert Mac IDE driver to platform driver
Date: Thu, 24 Sep 2020 13:29:21 +1200 [thread overview]
Message-ID: <1ae450be-0c26-f9e3-1544-3b58dbbf7e53@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.23.453.2009240929310.7@nippy.intranet>
Hi Finn,
On 24/09/20 1:07 PM, Finn Thain wrote:
> Looking further at the drivers using ide_host_register(), I see that
> falconide.c is missing a set_drvdata() call, while tx4939ide.c calls
> set_drvdata() after ide_host_register(). The latter example is not a bug.
>
> The pattern I used, that is, calling set_drvdata() after ide_host_add(),
> is actually more popular among IDE drivers than the pattern you suggested,
> that is, set_drvdata() followed by ide_host_register(). Either way, I
> don't see any bugs besides the one in falconide.c.
>
> Regarding falconide.c, my inclination is to send a fix following the more
> common pattern (among IDE drivers), as below. I guess that may prompt the
> subsystem maintainers to make known their views on the style question.
Please do - that is clearly a bug. I must admit I never tried to boot my
Falcon off a SCSI partition to test falconide module unload.
Cheers,
Michael
>
> diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c
> index dbeb2605e5f6e..607c44bc50f1b 100644
> --- a/drivers/ide/falconide.c
> +++ b/drivers/ide/falconide.c
> @@ -166,6 +166,7 @@ static int __init falconide_init(struct platform_device *pdev)
> if (rc)
> goto err_free;
>
> + platform_set_drvdata(pdev, host);
> return 0;
> err_free:
> ide_host_free(host);
> @@ -176,7 +177,7 @@ static int __init falconide_init(struct platform_device *pdev)
>
> static int falconide_remove(struct platform_device *pdev)
> {
> - struct ide_host *host = dev_get_drvdata(&pdev->dev);
> + struct ide_host *host = platform_get_drvdata(pdev);
>
> ide_host_remove(host);
>
next prev parent reply other threads:[~2020-09-24 1:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 2:42 Finn Thain
2020-09-14 11:42 ` Geert Uytterhoeven
2020-09-15 1:17 ` Finn Thain
2020-09-15 7:15 ` Geert Uytterhoeven
2020-09-15 22:56 ` Finn Thain
2020-09-24 1:07 ` Finn Thain
2020-09-24 1:29 ` Michael Schmitz [this message]
2020-09-24 7:21 ` Geert Uytterhoeven
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=1ae450be-0c26-f9e3-1544-3b58dbbf7e53@gmail.com \
--to=schmitzmic@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=fthain@telegraphics.com.au \
--cc=funaho@jurai.org \
--cc=geert@linux-m68k.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.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
all inboxes | Powered by JetHome®