Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Matti Vaittinen" <mazziesaccount@gmail.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	linux-iio@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] iio: adc: max1363: Use i2c_get_match_data()
Date: Tue, 15 Aug 2023 10:11:35 +0300	[thread overview]
Message-ID: <ZNslJ44ivDGKR6b1@smile.fi.intel.com> (raw)
In-Reply-To: <20230812072419.42645-1-biju.das.jz@bp.renesas.com>

On Sat, Aug 12, 2023 at 08:24:19AM +0100, Biju Das wrote:
> Replace device_get_match_data() and i2c_match_id() by
> i2c_get_match_data() by making similar I2C and DT-based matching
> table.

...

> +#define MAX1363_ID_TABLE(_name, cfg) {				\
> +	.name = _name,						\
> +	.driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[cfg],	\
> +}

Just use them directly, like in 4 lines each instead of a single one.

	{
		.name = max1361,
		.driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[max1361]
	},

or this, but it's almost 100 characters.

	{ .name = "max1361", .driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[max1361] },


Otherwise I prefer to see something like a generic macro in i2c.h

	I2C_DEVICE_DATA()

(in analogue with PCI_DEVICE_DATA).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-08-15  7:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12  7:24 [PATCH] iio: adc: max1363: Use i2c_get_match_data() Biju Das
2023-08-15  7:11 ` Andy Shevchenko [this message]
2023-08-18 14:48   ` Biju Das
2023-08-18 14:55     ` Andy Shevchenko
2023-08-18 17:07       ` Biju Das

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=ZNslJ44ivDGKR6b1@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=u.kleine-koenig@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