lkml.org 
[lkml]   [2023]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ata: Use of_property_read_reg() to parse "reg"
From
Date
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@kernel.org>
[...]


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

> 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

\
 
 \ /
  Last update: 2023-06-10 22:40    [W:0.110 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site