mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Joacim Zetterling <joacim.zetterling@westermo.com>
Cc: barebox@lists.infradead.org, a.fatoum@pengutronix.de
Subject: Re: [PATCH v2] ARM: imx: spi: Add NXP IMX8 Flex SPI/QSPI support
Date: Thu, 3 Mar 2022 10:58:57 +0100	[thread overview]
Message-ID: <20220303095857.GZ19585@pengutronix.de> (raw)
In-Reply-To: <20220301132232.343230-1-joacim.zetterling@westermo.com>

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2022-03-03 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 13:22 Joacim Zetterling
2022-03-03  9:58 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220303095857.GZ19585@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=joacim.zetterling@westermo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox