[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211126221345.5e17e48d@thinkpad>
Date: Fri, 26 Nov 2021 22:13:45 +0100
From: Marek BehĂșn <kabel@...nel.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Holger Brunck <holger.brunck@...achienergy.com>,
netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH 2/2] dsa: mv88e6xxx: make serdes SGMII/Fiber output
amplitude configurable
On Fri, 26 Nov 2021 21:43:45 +0100
Andrew Lunn <andrew@...n.ch> wrote:
> > > + if (chip->info->ops->serdes_set_out_amplitude && np) {
> > > + if (!of_property_read_u32(np, "serdes-output-amplitude",
> >
> > Hmm. Andrew, why don't we use <linux/property.h> instead of
> > <linux/of*.h> stuff in this dirver? Is there a reason or is this just
> > because it wasn't converted yet?
>
> The problem with device_property_read is that it takes a device. But
> this is not actually a device scoped property, it should be considered
> a port scoped property. And the port is not a device. DSA is not
> likely to convert to the device API because the device API is too
> limiting.
You're right, device_property_read() needs a device, and this seems
like a port-specific property. But from the patch it seems Holger is
using the switch device node:
struct device_node *np = chip->dev->of_node;
so either this is wrong or he could use device_property API. Of course
that would need a complete conversion, with device_* or fwnode_*.
functions. I was wondering if device_* + fwnode_* functions are
preferred instead of of_* functions (since they can be used also with
ACPI, for example).
Marek
Powered by blists - more mailing lists