All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Paolo Pisati <p.pisati@gmail.com>,
	Niklas Cassel <cassel@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-ide@vger.kernel.org, linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH v2 2/2] ata: pata_cswarp: Add Amiga cslab ata support
Date: Mon, 24 Mar 2025 07:00:47 -0400	[thread overview]
Message-ID: <60c4bdf5-9c6f-40d9-b7b9-2fbfde6fdfd1@kernel.org> (raw)
In-Reply-To: <20250324092409.99430-3-p.pisati@gmail.com>

On 2025/03/24 5:24, Paolo Pisati wrote:
> Driver for the on-board IDE interface on CS-Lab Warp Expansion Card
> (NOTE that idemode=native has to be set in Warp Configuration)
> 
> Signed-off-by: Paolo Pisati <p.pisati@gmail.com>

2 nits below.

[...]

> +static int pata_cswarp_probe(struct zorro_dev *z,
> +			     const struct zorro_device_id *ent)
> +{
> +	static const char board_name[] = "csWarp";
> +	struct ata_host *host;
> +	struct ata_port *ap;
> +	void __iomem *cswarp_ctrl_board, *base;
> +	unsigned long board = z->resource.start;
> +
> +	dev_info(&z->dev, "%s IDE controller (board: 0x%lx)\n", board_name,
> +		 board);
> +
> +	if (!devm_request_mem_region(&z->dev, board + WARP_OFFSET_ATA, 0x1800,
> +				     DRV_NAME))
> +		return -ENXIO;
> +
> +	/* allocate host */

Not a very useful comment :)
You can drop this as the function name is obvious.

> +	host = ata_host_alloc(&z->dev, 1);
> +	if (!host)
> +		return -ENXIO;
> +
> +	cswarp_ctrl_board = (void *)board;
> +
> +	ap = host->ports[0];
> +	base = cswarp_ctrl_board + WARP_OFFSET_ATA;
> +
> +	ap->ops = &pata_cswarp_ops;
> +
> +	ap->pio_mask = ATA_PIO4;
> +	ap->flags |= ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY |
> +		ATA_FLAG_PIO_POLLING;
> +
> +	ap->ioaddr.data_addr		= base;
> +	ap->ioaddr.error_addr		= base + 1 * 4;
> +	ap->ioaddr.feature_addr		= base + 1 * 4;
> +	ap->ioaddr.nsect_addr		= base + 2 * 4;
> +	ap->ioaddr.lbal_addr		= base + 3 * 4;
> +	ap->ioaddr.lbam_addr		= base + 4 * 4;
> +	ap->ioaddr.lbah_addr		= base + 5 * 4;
> +	ap->ioaddr.device_addr		= base + 6 * 4;
> +	ap->ioaddr.status_addr		= base + 7 * 4;
> +	ap->ioaddr.command_addr		= base + 7 * 4;
> +
> +	ap->ioaddr.altstatus_addr	= base + (0x1000 | (6UL << 2));
> +	ap->ioaddr.ctl_addr		= base + (0x1000 | (6UL << 2));
> +
> +	ata_port_desc(ap, "  cmd 0x%lx ctl 0x%lx", (unsigned long)base,
> +		      (unsigned long)ap->ioaddr.ctl_addr);
> +
> +	ata_host_activate(host, 0, NULL,
> +			  IRQF_SHARED, &pata_cswarp_sht);

	return ata_host_activate(host, 0, NULL,
				 IRQF_SHARED, &pata_cswarp_sht);

so that errors are properly reported.

> +
> +	return 0;
> +}
> +


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2025-03-24 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24  9:24 [PATCH v2 0/2] m68k: pata_cswarp: Add Amiga cslab ata support Paolo Pisati
2025-03-24  9:24 ` [PATCH v2 1/2] m68k: amiga_defconfig: enable PATA_CSWARP Paolo Pisati
2025-03-24 10:53   ` Damien Le Moal
2025-03-24 12:58     ` Geert Uytterhoeven
2025-03-24  9:24 ` [PATCH v2 2/2] ata: pata_cswarp: Add Amiga cslab ata support Paolo Pisati
2025-03-24 11:00   ` Damien Le Moal [this message]
2025-03-24 12:02     ` Paolo Pisati

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=60c4bdf5-9c6f-40d9-b7b9-2fbfde6fdfd1@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=p.pisati@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.