[PATCH v2] ARM: imx: spi: Add NXP IMX8 Flex SPI/QSPI support

Sascha Hauer sha at pengutronix.de
Thu Mar 3 01:58:57 PST 2022


On Tue, Mar 01, 2022 at 02:22:32PM +0100, Joacim Zetterling wrote:
> +
> +static const char *nxp_fspi_get_name(struct spi_mem *mem)
> +{
> +	struct nxp_fspi *f = spi_controller_get_devdata(mem->spi->master);
> +	struct device_d *dev = (struct device_d *)&mem->spi->dev;
> +	const char *name;
> +
> +	/* Set custom name derived from the platform_device of the controller.
> +	 */
> +	if (of_get_available_child_count(f->dev->device_node) == 1)
> +		return dev_name(f->dev);
> +
> +	name = basprintf("%s-%d", dev_name(f->dev), mem->spi->chip_select);
> +	if (!name) {
> +		dev_err(dev, "failed to get memory for custom flash name\n");
> +		return ERR_PTR(-ENOMEM);
> +	}
> +
> +	return name;
> +}

This should either return an allocated string or a static string, but
not both. This is copied from several other drivers in Linux upstream,
so leave it like this for now. Should be fixed upstream.

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list