[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba3b1a69496eb08cb071dace96fd385ff8f838e7.camel@perches.com>
Date: Thu, 26 Mar 2020 13:03:42 -0700
From: Joe Perches <joe@...ches.com>
To: florinel.iordache@....com, davem@...emloft.net,
netdev@...r.kernel.org, andrew@...n.ch, f.fainelli@...il.com,
hkallweit1@...il.com, linux@...linux.org.uk
Cc: devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
robh+dt@...nel.org, mark.rutland@....com, kuba@...nel.org,
corbet@....net, shawnguo@...nel.org, leoyang.li@....com,
madalin.bucur@....nxp.com, ioana.ciornei@....com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 7/9] net: phy: enable qoriq backplane support
On Thu, 2020-03-26 at 15:51 +0200, Florinel Iordache wrote:
> Enable backplane support for qoriq family of devices
trivial notes:
> diff --git a/drivers/net/phy/backplane/qoriq_backplane.c b/drivers/net/phy/backplane/qoriq_backplane.c
[]
> +static int qoriq_backplane_probe(struct phy_device *bpphy)
> +{
> + static bool one_time_action = true;
> +
> + if (one_time_action) {
> + one_time_action = false;
> + pr_info("%s: QorIQ Backplane driver version %s\n",
> + QORIQ_BACKPLANE_DRIVER_NAME,
> + QORIQ_BACKPLANE_DRIVER_VERSION);
> + }
There is an existing mechanism for this:
pr_info_once("%s: ... %s\n", etc...);
[]
> +static int qoriq_backplane_config_init(struct phy_device *bpphy)
> +{
[]
> + for (i = 0; i < bp_phy->num_lanes; i++) {
[]
> + ret = of_address_to_resource(lane_node, 0, &res);
> + if (ret) {
> + bpdev_err(bpphy,
> + "could not obtain lane memory map for index=%d, ret = %d\n",
> + i, ret);
> + return ret;
This could use the new vsprintf %pe extension:
bpdev_err(bpphy,
"could not obtain lane memory map for index=%d, %pe\n",
i, ERR_PTR(ret));
> + ret = of_address_to_resource(serdes_node, 0, &res);
> + if (ret) {
> + bpdev_err(bpphy,
> + "could not obtain serdes memory map, ret = %d\n",
> + ret);
> + return ret;
%pe etc.
[]
> + for (i = 0; i < comp_no; i++) {
> + ret = of_property_read_string_index(serdes_node, "compatible",
> + i, &serdes_comp);
> + if (ret == 0) {
> + if (!strcasecmp(serdes_comp, "serdes-10g")) {
> + serdes_type = SERDES_10G;
> + break;
> + } else if (!strcasecmp(serdes_comp, "serdes-28g")) {
> + serdes_type = SERDES_28G;
> + break;
> + }
> + }
> + }
[]
> +static int qoriq_backplane_match_phy_device(struct phy_device *bpphy)
> +{
[]
> + for (i = 0; i < comp_no; i++) {
> + ret = of_property_read_string_index(serdes_node, "compatible",
> + i, &serdes_comp);
> + if (ret == 0) {
> + if (!strcasecmp(serdes_comp, "serdes-10g")) {
> + serdes_type = SERDES_10G;
> + break;
> + } else if (!strcasecmp(serdes_comp, "serdes-28g")) {
> + serdes_type = SERDES_28G;
> + break;
> + }
> + }
> + }
[]
Maybe add and use a helper function?
Powered by blists - more mailing lists