Re: [PATCH] ata: Use of_property_read_reg() to parse "reg"

From: Sergey Shtylyov
Date: Sat Jun 10 2023 - 16:40:05 EST


Hello!

On 6/9/23 9:31 PM, Rob Herring wrote:

> Use the recently added of_property_read_reg() helper to get the
> untranslated "reg" address value.
>
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
[...]


Reviewed-by: Sergey Shtylyov <s.shtylyov@xxxxxx>

> diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
> index c47c3fb434d5..b3cc23d891d5 100644
> --- a/drivers/ata/sata_svw.c
[...]
> @@ -319,10 +320,10 @@ static int k2_sata_show_info(struct seq_file *m, struct Scsi_Host *shost)
> /* Match it to a port node */
> index = (ap == ap->host->ports[0]) ? 0 : 1;
> for (np = np->child; np != NULL; np = np->sibling) {
> - const u32 *reg = of_get_property(np, "reg", NULL);
> - if (!reg)
> + u64 reg;

An empty line wouldn't hurt here... :-)

> + if (of_property_read_reg(np, 0, &reg, NULL))
> continue;
> - if (index == *reg) {
> + if (index == reg) {
> seq_printf(m, "devspec: %pOF\n", np);
> break;
> }

MBR, Sergey