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>,
	linux-iio@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables
Date: Thu, 17 Aug 2023 13:26:14 +0300	[thread overview]
Message-ID: <ZN31xhUWgcJC3afb@smile.fi.intel.com> (raw)
In-Reply-To: <20230816184015.12420-1-biju.das.jz@bp.renesas.com>

On Wed, Aug 16, 2023 at 07:40:15PM +0100, Biju Das wrote:
> Convert enum->pointer for data in the match tables to simplify the probe()
> by replacing device_get_match_data() and i2c_client_get_device_id by
> i2c_get_match_data() as we have similar I2C, ACPI and DT matching table.

...

>  static const struct acpi_device_id ak_acpi_match[] = {
> +	{"AK8975", (kernel_ulong_t)&ak_def_array[AK8975] },
> +	{"AK8963", (kernel_ulong_t)&ak_def_array[AK8963] },
> +	{"INVN6500", (kernel_ulong_t)&ak_def_array[AK8963] },
> +	{"AK009911", (kernel_ulong_t)&ak_def_array[AK09911] },
> +	{"AK09911", (kernel_ulong_t)&ak_def_array[AK09911] },
> +	{"AKM9911", (kernel_ulong_t)&ak_def_array[AK09911] },
> +	{"AK09912", (kernel_ulong_t)&ak_def_array[AK09912] },

Please, sort them by HID. ACPI has no issues (as I learnt about OF) with
the ordering of IDs.

>  	{ }
>  };

...

> -	{"AK8963", AK8963},

> +	{"AK8963", (kernel_ulong_t)&ak_def_array[AK8963] },

Seems the wrong ID to begin with.

I would suggest to drop it in a separate patch.

...

>  static const struct of_device_id ak8975_of_match[] = {
> +	{ .compatible = "asahi-kasei,ak8975", .data = &ak_def_array[AK8975] },
> +	{ .compatible = "ak8975", .data = &ak_def_array[AK8975] },
> +	{ .compatible = "asahi-kasei,ak8963", .data = &ak_def_array[AK8963] },
> +	{ .compatible = "ak8963", .data = &ak_def_array[AK8963] },
> +	{ .compatible = "asahi-kasei,ak09911", .data = &ak_def_array[AK09911] },
> +	{ .compatible = "ak09911", .data = &ak_def_array[AK09911] },
> +	{ .compatible = "asahi-kasei,ak09912", .data = &ak_def_array[AK09912] },
> +	{ .compatible = "ak09912", .data = &ak_def_array[AK09912] },
> +	{ .compatible = "asahi-kasei,ak09916", .data = &ak_def_array[AK09916] },
> +	{ .compatible = "ak09916", .data = &ak_def_array[AK09916] },

Maybe the asashi being grouped it won't regress...

	{ .compatible = "asahi-kasei,ak8975", .data = &ak_def_array[AK8975] },
	{ .compatible = "asahi-kasei,ak8963", .data = &ak_def_array[AK8963] },
	{ .compatible = "asahi-kasei,ak09911", .data = &ak_def_array[AK09911] },
	{ .compatible = "asahi-kasei,ak09912", .data = &ak_def_array[AK09912] },
	{ .compatible = "asahi-kasei,ak09916", .data = &ak_def_array[AK09916] },
	{ .compatible = "ak8975", .data = &ak_def_array[AK8975] },
	{ .compatible = "ak8963", .data = &ak_def_array[AK8963] },
	{ .compatible = "ak09911", .data = &ak_def_array[AK09911] },
	{ .compatible = "ak09912", .data = &ak_def_array[AK09912] },
	{ .compatible = "ak09916", .data = &ak_def_array[AK09916] },

>  	{}
>  };

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2023-08-17 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 18:40 [PATCH] iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables Biju Das
2023-08-17 10:26 ` Andy Shevchenko [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=ZN31xhUWgcJC3afb@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=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