Linux CAN drivers development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, manivannan.sadhasivam@linaro.org,
	dev.kurt@vandijck-laurijssen.be
Subject: Re: [PATCH v53 2/6] can: mcp25xxfd: add regmap infrastructure
Date: Mon, 21 Sep 2020 20:33:02 +0100	[thread overview]
Message-ID: <20200921193302.GA45062@sirena.org.uk> (raw)
In-Reply-To: <20200918172536.2074504-3-mkl@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

On Fri, Sep 18, 2020 at 07:25:32PM +0200, Marc Kleine-Budde wrote:

> +static int
> +mcp25xxfd_regmap_nocrc_update_bits(void *context, unsigned int reg,
> +				   unsigned int mask, unsigned int val)
> +{

This doesn't look like the hardware has an update_bits() operation so
why is there a driver specific implementation?

> +static int
> +mcp25xxfd_regmap_init_nocrc(struct mcp25xxfd_priv *priv)
> +{
> +	if (!priv->map_nocrc) {
> +		struct regmap *map;
> +
> +		map = devm_regmap_init(&priv->spi->dev, &mcp25xxfd_bus_nocrc,
> +				       priv->spi, &mcp25xxfd_regmap_nocrc);

Why all these checks to see if things might already be allocated?

> +static void mcp25xxfd_regmap_destroy_nocrc(struct mcp25xxfd_priv *priv)
> +{
> +	if (priv->map_buf_nocrc_rx) {
> +		devm_kfree(&priv->spi->dev, priv->map_buf_nocrc_rx);
> +		priv->map_buf_nocrc_rx = NULL;
> +	}

Why explicitly free managed allocations like this?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-09-21 19:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 17:25 [PATCH v53 1/6] mcp25xxfd: initial driver support Marc Kleine-Budde
2020-09-18 17:25 ` [PATCH v53 1/6] dt-binding: can: mcp25xxfd: document device tree bindings Marc Kleine-Budde
2020-09-18 17:25 ` [PATCH v53 2/6] can: mcp25xxfd: add regmap infrastructure Marc Kleine-Budde
2020-09-21 19:33   ` Mark Brown [this message]
2020-09-22  5:57     ` Marc Kleine-Budde
2020-09-22 12:13       ` Mark Brown
2020-09-22 13:56         ` Marc Kleine-Budde
2020-09-22 14:23           ` Mark Brown
2020-09-18 17:25 ` [PATCH v53 3/6] can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN Marc Kleine-Budde
2020-09-18 17:25 ` [PATCH v53 4/6] can: mcp25xxfd: add listen-only mode Marc Kleine-Budde
2020-09-18 17:25 ` [PATCH v53 5/6] MAINTAINERS: Add entry for Microchip MCP25XXFD SPI-CAN network driver Marc Kleine-Budde
2020-09-18 17:25 ` [PATCH v53 6/6] MAINTAINERS: Add reviewer entry for microchip mcp25xxfd " Marc Kleine-Budde

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=20200921193302.GA45062@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mkl@pengutronix.de \
    /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