[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuKLGYThw8xBKw7E@HYD-DK-UNGSW21.microchip.com>
Date: Thu, 12 Sep 2024 12:02:57 +0530
From: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
CC: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>, <netdev@...r.kernel.org>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <bryan.whitehead@...rochip.com>,
<UNGLinuxDriver@...rochip.com>, <linux@...linux.org.uk>,
<maxime.chevallier@...tlin.com>, <rdunlap@...radead.org>, <andrew@...n.ch>,
<Steen.Hegelund@...rochip.com>, <daniel.machon@...rochip.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next V2 2/5] net: lan743x: Add support to
software-nodes for sfp
Hi Christophe,
The 09/11/2024 18:54, Christophe JAILLET wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Le 11/09/2024 à 18:10, Raju Lakkaraju a écrit :
> > Register software nodes and define the device properties.
> > software-node contains following properties.
> > - gpio pin details
> > - i2c bus information
> > - sfp signals
> > - phylink mode
> >
> > Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
>
> Hi,
>
> ...
>
> > +static int pci1xxxx_i2c_adapter_get(struct lan743x_adapter *adapter)
> > +{
> > + struct pci1xxxx_i2c *i2c_drvdata;
> > +
> > + i2c_drvdata = pci1xxxx_perif_drvdata_get(adapter, PCI1XXXX_PERIF_I2C_ID);
> > + if (!i2c_drvdata)
> > + return -EPROBE_DEFER;
> > +
> > + adapter->i2c_adap = &i2c_drvdata->adap;
> > + snprintf(adapter->nodes->i2c_name, sizeof(adapter->nodes->i2c_name),
> > + adapter->i2c_adap->name);
>
> strscpy() ?
>
Accepted. I will fix.
Here snprintf( ) does not take any format string, we can use strscpy( ).
> > + netif_dbg(adapter, drv, adapter->netdev, "Found %s\n",
> > + adapter->i2c_adap->name);
> > +
> > + return 0;
> > +}
> > +
> > +static int pci1xxxx_gpio_dev_get(struct lan743x_adapter *adapter)
> > +{
> > + struct aux_bus_device *aux_bus;
> > + struct device *gpio_dev;
> > +
> > + aux_bus = pci1xxxx_perif_drvdata_get(adapter, PCI1XXXX_PERIF_GPIO_ID);
> > + if (!aux_bus)
> > + return -EPROBE_DEFER;
> > +
> > + gpio_dev = &aux_bus->aux_device_wrapper[1]->aux_dev.dev;
> > + snprintf(adapter->nodes->gpio_name, sizeof(adapter->nodes->gpio_name),
> > + dev_name(gpio_dev));
>
> strscpy() ?
>
Accepted. I will fix.
> > + netif_dbg(adapter, drv, adapter->netdev, "Found %s\n",
> > + adapter->i2c_adap->name);
> > +
> > + return 0;
> > +}
> > +
> > +static int pci1xxxx_gpio_dev_get(struct lan743x_adapter *adapter)
> > +{
> > + struct aux_bus_device *aux_bus;
> > + struct device *gpio_dev;
> > +
> > + aux_bus = pci1xxxx_perif_drvdata_get(adapter, PCI1XXXX_PERIF_GPIO_ID);
> > + if (!aux_bus)
> > + return -EPROBE_DEFER;
> > +
> > + gpio_dev = &aux_bus->aux_device_wrapper[1]->aux_dev.dev;
> > + snprintf(adapter->nodes->gpio_name, sizeof(adapter->nodes->gpio_name),
> > + dev_name(gpio_dev));
>
> strscpy() ?
Accepted. I will fix.
> > + netif_dbg(adapter, drv, adapter->netdev, "Found %s\n",
> > + adapter->i2c_adap->name);
> > +
> > + return 0;
> > +}
> > +
> > +static int pci1xxxx_gpio_dev_get(struct lan743x_adapter *adapter)
> > +{
> > + struct aux_bus_device *aux_bus;
> > + struct device *gpio_dev;
> > +
> > + aux_bus = pci1xxxx_perif_drvdata_get(adapter, PCI1XXXX_PERIF_GPIO_ID);
> > + if (!aux_bus)
> > + return -EPROBE_DEFER;
> > +
> > + gpio_dev = &aux_bus->aux_device_wrapper[1]->aux_dev.dev;
> > + snprintf(adapter->nodes->gpio_name, sizeof(adapter->nodes->gpio_name),
> > + dev_name(gpio_dev));
>
> strscpy() ?
> > + netif_dbg(adapter, drv, adapter->netdev, "Found %s\n",
> > + adapter->nodes->gpio_name);
> > + return 0;
> > +}
> > +
>
> ...
--
Thanks,
Raju
Powered by blists - more mailing lists