public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-acpi@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Wolfram Sang <wsa@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drivers: fwnode: Extend device_get_match_data() to struct bus_type
Date: Tue, 1 Aug 2023 22:39:13 +0300	[thread overview]
Message-ID: <ZMlfYU3rOQle0VuH@smile.fi.intel.com> (raw)
In-Reply-To: <20230801170318.82682-2-biju.das.jz@bp.renesas.com>

On Tue, Aug 01, 2023 at 06:03:17PM +0100, Biju Das wrote:
> Extend device_get_match_data() to buses (for eg: I2C) by adding a
> callback device_get_match_data() to struct bus_type() and call this method
> as a fallback for generic fwnode based device_get_match_data().

Because of anticipation of v4, see one additional comment below.

...

> +/**
> + * device_get_match_data - get match data from OF/ACPI/Bus match tables
> + * @dev: device to find the match data
> + *
> + * Find match data using generic fwnode-based lookup and if there is no
> + * match, call the bus->get_match_data() for finding match data.
> + *
> + * Return: a match data pointer or NULL if there is no match in the matching
> + * table.

Also add a note for the corner case.

"""
 *
 * Besides the fact that some drivers abuse the device ID driver_data type
 * and claim it to be integer, for the bus specific ID tables the driver_data
 * may be defined as kernel_ulong_t. For these tables 0 is a valid response,
 * but not for this function. It's recommended to covert those either to avoid
 * 0 or use a real pointer to the predefined driver data.
"""

> + */

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-08-01 19:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 17:03 [PATCH v3 0/2] Extend device_get_match_data() to struct bus_type Biju Das
2023-08-01 17:03 ` [PATCH v3 1/2] drivers: fwnode: " Biju Das
2023-08-01 19:39   ` Andy Shevchenko [this message]
2023-08-02  6:32     ` Biju Das
2023-08-02 14:46       ` Andy Shevchenko

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=ZMlfYU3rOQle0VuH@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=djrscally@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=wsa@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