[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1KNgS6xQ1VhMjo1@sirena.org.uk>
Date: Fri, 21 Oct 2022 13:16:01 +0100
From: Mark Brown <broonie@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>
Subject: Re: [PATCH v4 1/5] spi: pxa2xx: Respect Intel SSP type given by a
property
On Thu, Oct 20, 2022 at 10:44:56PM +0300, Andy Shevchenko wrote:
> Allow to set the Intel SSP type by reading the property.
> Only apply this to the known MFD enumerated devices.
> + /* For MFD enumerated devices always ask for a property */
> + mfd_enumerated = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv");
> + if (mfd_enumerated) {
> + status = device_property_read_u32(dev, "intel,spi-pxa2xx-type", &value);
> + if (status)
> + return ERR_PTR(status);
> + }
> +
> if (pcidev)
> pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev);
>
> match = device_get_match_data(&pdev->dev);
> if (match)
> type = (enum pxa_ssp_type)match;
> + else if (value > SSP_UNDEFINED && value < SSP_MAX)
> + type = (enum pxa_ssp_type)value;
This is quite hard to follow, partly because value isn't exactly a clear
variable name and partly because the initialisation to SSP_UNDEFINED,
the attempt to read via device property and this if/else chain are split
up and not clearly joined up with each other. This is partly an issue
with the existing code but the extra layer of spreading things
throughout the function being added amplifies things a bit.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists