Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Ariana Lazar <ariana.lazar@microchip.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v5 08/10] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules
Date: Thu, 10 Sep 2026 09:16:29 +0300	[thread overview]
Message-ID: <aqJLPT_pIH2pbZaB@ashevche-desk.local> (raw)
In-Reply-To: <20260909-mcp47feb02_refactor-v5-8-8b67bcab93d1@microchip.com>

On Wed, Sep 09, 2026 at 05:18:51PM +0300, Ariana Lazar wrote:
> Prepare the driver for the bus-specific code by refactoring into separate
> files. The renamed file will contain the common DAC functionality shared by
> the MCP47FxBy1/2/4/8 I2C and MCP48FxBy1/2/4/8 SPI drivers. The MCP47FEB02
> driver was refactored into two modules: mcp47feb02-core.c and
> mcp47feb02-i2c.c in order to prepare the support for SPI MCP48FxBy1/2/4/8
> DAC family on top of the current implementation.

...

> +static int mcp47feb02_i2c_probe(struct i2c_client *client)
> +{
> +	const struct mcp47feb02_features *chip_features;
> +	struct device *dev = &client->dev;
> +	struct regmap *regmap;
> +
> +	chip_features = i2c_get_match_data(client);
> +	if (!chip_features)
> +		return dev_err_probe(dev, -ENODEV, "No I2C device found\n");

Consider adding a patch that replaces ENODEV with ENODATA as we started doing
in the other drivers. This will help to distinguish the source of the error.
Also fix the error message accordingly. It's not about device.

> +	if (chip_features->have_eeprom)
> +		regmap = devm_regmap_init_i2c(client, &mcp47feb02_regmap_config);
> +	else
> +		regmap = devm_regmap_init_i2c(client, &mcp47fvb02_regmap_config);
> +
> +	if (IS_ERR(regmap))
> +		return dev_err_probe(dev, PTR_ERR(regmap), "Error initializing I2C regmap\n");
> +
> +	return mcp47feb02_common_probe(chip_features, regmap);
> +}

...

> +#ifndef __DRIVERS_IIO_DAC_MCP47FEB02_H__
> +#define __DRIVERS_IIO_DAC_MCP47FEB02_H__
> +
> +#include <linux/pm.h>

+ regmap.h for struct regmap_config.

> +#include <linux/types.h>

> +#endif /* __DRIVERS_IIO_DAC_MCP47FEB02_H__ */

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2026-09-10  6:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 14:18 [PATCH v5 00/10] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver Ariana Lazar
2026-09-09 14:18 ` [PATCH v5 01/10] iio: dac: mcp47feb02: initialize dac_data field in channel data struct at probe Ariana Lazar
2026-09-09 14:32   ` sashiko-bot
2026-09-09 14:18 ` [PATCH v5 02/10] iio: dac: mcp47feb02: Fix gain field initialization for active channels Ariana Lazar
2026-09-13 21:43   ` Jonathan Cameron
2026-09-09 14:18 ` [PATCH v5 03/10] iio: dac: mcp47feb02: Return len when disabling EEPROM store Ariana Lazar
2026-09-09 14:33   ` sashiko-bot
2026-09-09 14:18 ` [PATCH v5 04/10] iio: dac: mcp47feb02: Increase EEPROM Programming Write Cycle Time Ariana Lazar
2026-09-09 14:31   ` sashiko-bot
2026-09-10  6:11   ` Andy Shevchenko
2026-09-09 14:18 ` [PATCH v5 05/10] iio: dac: mcp47feb02: Avoid unjustified probe failure on missing label Ariana Lazar
2026-09-09 14:40   ` sashiko-bot
2026-09-10  6:12   ` Andy Shevchenko
2026-09-09 14:18 ` [PATCH v5 06/10] iio: dac: mcp47feb02: correct typo from a comment Ariana Lazar
2026-09-09 14:18 ` [PATCH v5 07/10] iio: dac: mcp47feb02: rename command mask define Ariana Lazar
2026-09-09 14:39   ` sashiko-bot
2026-09-09 14:18 ` [PATCH v5 08/10] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules Ariana Lazar
2026-09-09 14:47   ` sashiko-bot
2026-09-10  6:16   ` Andy Shevchenko [this message]
2026-09-13 21:51   ` Jonathan Cameron
2026-09-09 14:18 ` [PATCH v5 09/10] dt-bindings: iio: dac: add support for MCP48FEB02 SPI Ariana Lazar
2026-09-09 14:48   ` sashiko-bot
2026-09-09 14:18 ` [PATCH v5 10/10] iio: dac: add support for Microchip MCP48FEB02 Ariana Lazar
2026-09-09 14:51   ` sashiko-bot
2026-09-10  6:17   ` Andy Shevchenko
2026-09-10  6:18 ` [PATCH v5 00/10] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver Andy Shevchenko
2026-09-13 21:55   ` Jonathan Cameron

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=aqJLPT_pIH2pbZaB@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=ariana.lazar@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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