From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: "Linux/m68k" <linux-m68k@vger.kernel.org>,
linux-ide@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device
Date: Tue, 3 Sep 2019 14:44:12 +0200 [thread overview]
Message-ID: <CAMuHMdXeb2gUz92C-QqWmVLnpncArMkzgsJKNSz3F8J6ri89TQ@mail.gmail.com> (raw)
In-Reply-To: <1562018556-15090-3-git-send-email-schmitzmic@gmail.com>
Hi Michael,
On Tue, Jul 2, 2019 at 12:02 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> The Atari platform device setup now provides a platform device
> for the Falcon IDE interface. Use this in place of the simple platform
> device set up in the old pata_falcon probe code.
>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Thanks for your patch!
> --- a/drivers/ata/pata_falcon.c
> +++ b/drivers/ata/pata_falcon.c
> @@ -120,23 +120,21 @@ static int pata_falcon_set_mode(struct ata_link *link,
> .set_mode = pata_falcon_set_mode,
> };
>
> -static int pata_falcon_init_one(void)
> +static int __init pata_falcon_init_one(struct platform_device *pdev)
> {
> + struct resource *res;
> struct ata_host *host;
> struct ata_port *ap;
> - struct platform_device *pdev;
> void __iomem *base;
>
> - if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE))
> - return -ENODEV;
> -
> - pr_info(DRV_NAME ": Atari Falcon PATA controller\n");
> + dev_info(&pdev->dev, ": Atari Falcon PATA controller\n");
>
> - pdev = platform_device_register_simple(DRV_NAME, 0, NULL, 0);
> - if (IS_ERR(pdev))
> - return PTR_ERR(pdev);
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res)
> + return -ENODEV;
>
> - if (!devm_request_mem_region(&pdev->dev, ATA_HD_BASE, 0x40, DRV_NAME)) {
ATA_HD_BASE is now unused, and can be removed.
> + if (!devm_request_mem_region(&pdev->dev, res->start,
> + resource_size(res), DRV_NAME)) {
> pr_err(DRV_NAME ": resources busy\n");
dev_err(&pdev->dev, "resources busy\n");
> return -EBUSY;
> }
> @@ -174,9 +172,26 @@ static int pata_falcon_init_one(void)
> return ata_host_activate(host, 0, NULL, 0, &pata_falcon_sht);
> }
>
> -module_init(pata_falcon_init_one);
> +static int __exit pata_falcon_remove_one(struct platform_device *pdev)
> +{
> + struct ata_host *host = platform_get_drvdata(pdev);
> +
> + ata_host_detach(host);
> +
> + return 0;
> +}
> +
> +static struct platform_driver pata_falcon_driver = {
> + .remove = __exit_p(pata_falcon_remove_one),
> + .driver = {
> + .name = "atari-falcon-ide",
> + },
> +};
> +
> +module_platform_driver_probe(pata_falcon_driver, pata_falcon_init_one);
This doesn't seem to work in the builtin case (e.g. atari_defconfig with
ide replaced by ata): no hard drives are detected.
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-09-03 12:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 22:02 [PATCH 0/2] Convert Atari Falcon IDE driver to platform device Michael Schmitz
2019-07-01 22:02 ` [PATCH 1/2] m68k/atari: add platform device for Falcon IDE port Michael Schmitz
2019-07-02 12:50 ` Bartlomiej Zolnierkiewicz
2019-09-03 12:40 ` Geert Uytterhoeven
2019-07-01 22:02 ` [PATCH 2/2] drivers/ata: convert pata_falcon to arch platform device Michael Schmitz
2019-07-02 12:51 ` Bartlomiej Zolnierkiewicz
2019-07-30 11:59 ` John Paul Adrian Glaubitz
2019-09-03 12:44 ` Geert Uytterhoeven [this message]
2019-09-25 3:59 ` Michael Schmitz
2019-11-04 10:31 ` 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=CAMuHMdXeb2gUz92C-QqWmVLnpncArMkzgsJKNSz3F8J6ri89TQ@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=b.zolnierkie@samsung.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-m68k@vger.kernel.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).