From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85297C41513 for ; Tue, 1 Aug 2023 19:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbjHATjX (ORCPT ); Tue, 1 Aug 2023 15:39:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231517AbjHATjW (ORCPT ); Tue, 1 Aug 2023 15:39:22 -0400 Received: from mgamail.intel.com (unknown [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 992B91BF1; Tue, 1 Aug 2023 12:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690918759; x=1722454759; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Oa6jUYKUJk4xKUInJM8nAus+RSs4y5jHWcsddX766Yg=; b=VJzPBS0UJCH8Brf9Y3XSw38kjbdLeCtO/RSit8IM9wgFyOQtT4RvLx0G Oxx2p6yfMLZRnI8G/Mci+VgJHqBFdJmfxFcV5JO7MFm90+HVoP6SnvI3Q XWt7CpKFfzxhwRS9Q+ABUVA0zlbDq0ig1r3PYP6//kVKXJjqCjONrMoci HvPxQYJ9LtdHj/bLkZWOorcOnqXLpMIM1ZhGonY9ZREi4QbA4R3v7q2n4 QI+0s++FVFk89NP1AqjVAnIT3CuTc6cGpRSI+Chv3dg9w0CuB/g/gaYxa xJmeOZ40ryi5R4DDCDGsMQn8iUuIw8CCsVnRyS8fR2YbFXwVWU+MHMsPp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="373038043" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="373038043" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2023 12:39:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="798793810" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="798793810" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 01 Aug 2023 12:39:15 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qQvD7-00Gxg7-1t; Tue, 01 Aug 2023 22:39:13 +0300 Date: Tue, 1 Aug 2023 22:39:13 +0300 From: Andy Shevchenko To: Biju Das Cc: Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Dmitry Torokhov , Wolfram Sang , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v3 1/2] drivers: fwnode: Extend device_get_match_data() to struct bus_type Message-ID: References: <20230801170318.82682-1-biju.das.jz@bp.renesas.com> <20230801170318.82682-2-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801170318.82682-2-biju.das.jz@bp.renesas.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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