Re: [PATCH v4 2/3] spi: Add a mechanism to use the fwnode name for the SPI device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 09, 2024 at 09:06:56PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 09, 2024 at 02:21:25PM +0100, Charles Keepax wrote:
> > Add a mechanism to force the use of the fwnode name for the name of the
> > SPI device itself. This is useful when devices need to be manually added
> > within the kernel.
> 
> Same comment, we don't need two ways to handle fwnode type
> (and effectivelly code duplication to some extent).
> 
> ...
> 
> >  	struct acpi_device *adev = ACPI_COMPANION(&spi->dev);
> 
> >  	if (adev) {
> 
> Replace this to be is_acpi_device_node() check...
> 
> >  		dev_set_name(&spi->dev, "spi-%s", acpi_dev_name(adev));
> 
> ...and derive adev from fwnode.
> 

I had been hoping to not modify the path I wasn't using but fair
enough if you are sure this is a fine substitution.

> >  		return;
> >  	}
> 
> > +	if (is_software_node(fwnode)) {
> > +		dev_set_name(&spi->dev, "spi-%s", fwnode_get_name(fwnode));
> 
> While at this, you can also introduce
> 
> 	struct device *dev = &spi->dev;
> 
> to make these dev_set_name() be shorter.
> 

Sure.

Thanks,
Charles




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux