linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/28] drivers: Consolidate device lookup helpers
@ 2019-06-14 17:53 Suzuki K Poulose
  2019-06-14 17:54 ` [PATCH v2 06/28] drivers: Add generic helper to match by of_node Suzuki K Poulose
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-14 17:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, rafael, suzuki.poulose, Alan Tull, Alessandro Zummo,
	Alexander Aring, Alexander Shishkin, Alexandre Belloni,
	Andreas Noever, Andrew Lunn, Arnd Bergmann, Bjorn Helgaas,
	Corey Minyard, Daniel Vetter, Dan Murphy, David Airlie,
	David Kershner, David S. Miller, Doug Ledford, dri-devel,
	Elie Morisse, Eric Anholt, Felipe Balbi, Florian Fainelli,
	Frank Rowand, Grant Likely, Grygorii Strashko,
	Harald Freudenberger, Hartmut Knaack, Heikki Krogerus,
	Heiko Carstens, Heiko Stübner, Heiner Kallweit, Inki Dae,
	Jacek Anaszewski, James E.J. Bottomley, Jason Gunthorpe,
	Jiri Slaby, Joe Perches, Joerg Roedel, Jonathan Cameron,
	Jonathan Hunter, Lee Jones, Len Brown, Liam Girdwood,
	Maarten Lankhorst, Mark Brown, Martin K. Petersen,
	Mathieu Poirier, Maxime Coquelin, Maxime Ripard, Michael Jamet,
	Mika Westerberg, Moritz Fischer, Nehal Shah, Oliver Neukum,
	Pavel Machek, Peter Oberparleiter, Peter Rosin, Rafael J. Wysocki,
	Rafael J . Wysocki , Rob Herring, Robin Murphy, Russell King,
	Sandy Huang, Sebastian Andrzej Siewior, Sebastian Ott,
	Seung-Woo Kim, Shyam Sundar S K, Srinivas Kandagatla,
	Stefan Schmidt, Takashi Iwai, Thierry Reding, Thor Thayer,
	Tomas Winkler, Ulf Hansson, Will Deacon, Wolfram Sang, devicetree,
	linux-acpi, linux-fpga, linux-i2c, linux-leds, linux-rockchip,
	linux-rtc, linux-spi, linux-usb, linux-wpan

We have device iterators to find a particular device matching a criteria
for a given bus/class/driver. i.e, {bus,class,driver}_find_device() APIs.
The matching criteria is a function pointer for the APIs. Often the lookup
is based on a generic property of a device (e.g, name, fwnode, of node pointer
or device type) rather than a driver specific information. However, each driver
writes up its own "match" function, spilling the similar match functions all
over the driver subsystems.

Additionally the prototype for the "match" functions accepted by the above APIs
have a minute difference which prevents us otherwise sharing the match functions.
i.e,
	int (*match)(struct device *dev, void *data) for {bus/driver}_find_device()
	  vs
	int (*match)(struct device *dev, const void *) for class_find_device()

If we promote the former to accept a "const void*" parameter, we could share one
single match function for all the helpers. This series achieves the following:

 a) [Patches 03-05] Unify the prototype for "match" functions accepted by the
     device lookup APIs.
 b) [Patches 06-11] Introduce generic match functions to match devices by the
     generic attributes of a device (e.g, name, fwnode, of_node and devt).

 c) [Patches 12-27] Also, in order to prevent creation of such match functions
    in the future, we introduce wrapper functions for the look up APIs, which
    automatically uses the appropriate match functions.

    i.e,
	{bus/class/driver}_find_device_by_name
	{bus/class/driver}_find_device_by_of_node
	{bus/class/driver}_find_device_by_fwnode
	{bus/class/driver}_find_device_by_devt
	{bus/class/driver}_find_device_by_acpi_dev
	{bus/class/driver}_find_next_device

     and converts the existing users to switch to the new helpers.

 d) [Patch 28] Additionally, this series also adds wrapper for finding a
    device by matching a device driver for platform bus devices -

		 platform_find_device_by_driver()

    to avoid a few drivers hard coding the platform bus specific details.

Applies on v5.2-rc4, available at [0]

    [0] git://linux-arm.org/linux-skp.git driver-cleanup/v2
RFC [1] https://marc.info/?i=1559577023-558-1-git-send-email-suzuki.poulose@arm.com
V1  [2] https://marc.info/?i=1559747630-28065-1-git-send-email-suzuki.poulose@arm.com

Changes since v1:
 - Drop start parameter for *_find_device_by_devt().
 - Fix build warnings for s390
 - Add *_find_device_by_acpi_dev() wrappers.
 - Group wrappers and the consumers into single patch, reducing
   the total patches to 28 from 57. (Rafael).
 - Better description for acpi cleanup patch.
 - Added tags from v1.

Cc: Alan Tull <atull@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: David Airlie <airlied@linux.ie>
Cc: David Kershner <david.kershner@unisys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Doug Ledford <dledford@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Elie Morisse <syniurge@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Grant Likely <grant.likely@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Joe Perches <joe@perches.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Len Brown <lenb@kernel.org
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Moritz Fischer <mdf@kernel.org>
Cc: Nehal Shah <nehal-bakulchandra.shah@amd.com>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Peter Rosin <peda@axentia.se>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Ott <sebott@linux.ibm.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Stefan Schmidt <stefan@datenfreihafen.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thor Thayer <thor.thayer@linux.intel.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: devicetree@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-fpga@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-leds@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-rtc@vger.kernel.org
Cc: linux-spi@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-wpan@vger.kernel.org

Suzuki K Poulose (28):
  staging: most-core: Use bus_find_device_by_name
  mfd: Remove unused helper syscon_regmap_lookup_by_pdevname
  acpi: utils: Cleanup acpi_dev_match_cb
  bus_find_device: Unify the match callback with class_find_device
  driver_find_device: Unify the match function with class_find_device()
  drivers: Add generic helper to match by of_node
  drivers: Add generic helper to match by fwnode
  drivers: Add generic helper to match by device type
  drivers: Add generic match helper by ACPI_COMPANION device
  drivers: Add generic helper to match by name
  drivers: Add generic helper to match any device
  drivers: Introduce class_find_device_by_name() helper
  drivers: Introduce class_find_device_by_of_node() helper
  drivers: Introduce class_find_device_by_fwnode() helper
  drivers: Introduce class_find_device_by_devt() helper
  drivers: Introduce class_find_device_by_acpi_dev() helper
  drivers: Introduce bus_find_device_by_of_node() helper
  drivers: Introduce bus_find_device_by_fwnode() helper
  drivers: Introduce bus_find_device_by_devt() helper
  drivers: Introduce bus_find_next_device() helper
  drivers: Introduce bus_find_device_by_acpi_dev() helper
  drivers: Introduce driver_find_device_by_name() helper
  drivers: Introduce driver_find_device_by_of_node() helper
  drivers: Introduce driver_find_device_by_fwnode() helper
  drivers: Introduce driver_find_device_by_devt() helper
  drivers: Introduce driver_find_next_device() helper
  drivers: Introduce driver_find_device_by_acpi_dev() helper
  platform: Add platform_find_device_by_driver() helper

 arch/powerpc/platforms/pseries/ibmebus.c           |   4 +-
 drivers/acpi/acpi_lpss.c                           |   4 +-
 drivers/acpi/sleep.c                               |   2 +-
 drivers/acpi/utils.c                               |  11 +-
 drivers/amba/tegra-ahb.c                           |  11 +-
 drivers/base/bus.c                                 |  28 +--
 drivers/base/core.c                                |  45 +++-
 drivers/base/devcon.c                              |   8 +-
 drivers/base/driver.c                              |   4 +-
 drivers/base/platform.c                            |  14 ++
 drivers/char/ipmi/ipmi_msghandler.c                |   8 +-
 drivers/char/ipmi/ipmi_si_platform.c               |   2 +-
 drivers/firmware/efi/dev-path-parser.c             |   4 +-
 drivers/fpga/fpga-bridge.c                         |   8 +-
 drivers/fpga/fpga-mgr.c                            |   8 +-
 drivers/fpga/of-fpga-region.c                      |   7 +-
 drivers/gpu/drm/drm_mipi_dsi.c                     |   7 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c            |   9 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c        |   3 +-
 drivers/gpu/drm/tegra/dc.c                         |   4 +-
 drivers/gpu/drm/vc4/vc4_drv.c                      |   3 +-
 drivers/hwtracing/coresight/coresight.c            |   6 +-
 drivers/hwtracing/coresight/of_coresight.c         |  11 +-
 drivers/hwtracing/intel_th/core.c                  |  11 +-
 drivers/hwtracing/stm/core.c                       |   9 +-
 drivers/i2c/busses/i2c-amd-mp2-pci.c               |   8 +-
 drivers/i2c/i2c-core-acpi.c                        |  10 +-
 drivers/i2c/i2c-core-of.c                          |   9 +-
 drivers/iio/inkern.c                               |   2 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c         |   8 +-
 drivers/iommu/arm-smmu-v3.c                        |   9 +-
 drivers/iommu/arm-smmu.c                           |   9 +-
 drivers/leds/led-class.c                           |   9 +-
 drivers/mfd/altera-sysmgr.c                        |  14 +-
 drivers/mfd/syscon.c                               |  21 --
 drivers/misc/mei/main.c                            |   9 +-
 drivers/mux/core.c                                 |   7 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c |   8 +-
 drivers/net/ethernet/ti/cpsw-phy-sel.c             |   4 +-
 drivers/net/ethernet/ti/davinci_emac.c             |   2 +-
 drivers/net/ethernet/toshiba/tc35815.c             |   4 +-
 drivers/net/phy/mdio_bus.c                         |   9 +-
 drivers/nvmem/core.c                               |   7 +-
 drivers/of/of_mdio.c                               |   8 +-
 drivers/of/platform.c                              |   7 +-
 drivers/pci/probe.c                                |   7 +-
 drivers/pci/search.c                               |   4 +-
 drivers/regulator/of_regulator.c                   |   7 +-
 drivers/rtc/interface.c                            |  11 +-
 drivers/s390/cio/ccwgroup.c                        |  18 +-
 drivers/s390/cio/chsc_sch.c                        |   2 +-
 drivers/s390/cio/css.c                             |   4 +-
 drivers/s390/cio/device.c                          |  21 +-
 drivers/s390/cio/scm.c                             |   4 +-
 drivers/s390/crypto/ap_bus.c                       |   8 +-
 drivers/s390/crypto/zcrypt_api.c                   |  22 +-
 drivers/scsi/scsi_proc.c                           |   9 +-
 drivers/spi/spi.c                                  |  28 +--
 drivers/staging/most/core.c                        |   9 +-
 drivers/thunderbolt/switch.c                       |   4 +-
 drivers/tty/tty_io.c                               |   8 +-
 drivers/usb/core/devio.c                           |   8 +-
 drivers/usb/core/usb.c                             |   4 +-
 drivers/usb/phy/phy-am335x-control.c               |   4 +-
 drivers/usb/phy/phy-isp1301.c                      |   4 +-
 drivers/usb/roles/class.c                          |  16 +-
 drivers/usb/typec/class.c                          |  16 +-
 drivers/visorbus/visorbus_main.c                   |   4 +-
 include/linux/device.h                             | 247 ++++++++++++++++++++-
 include/linux/mfd/syscon.h                         |   6 -
 include/linux/platform_device.h                    |   3 +
 net/ieee802154/core.c                              |   7 +-
 sound/soc/rockchip/rk3399_gru_sound.c              |   9 +-
 73 files changed, 407 insertions(+), 482 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 06/28] drivers: Add generic helper to match by of_node
  2019-06-14 17:53 [PATCH v2 00/28] drivers: Consolidate device lookup helpers Suzuki K Poulose
@ 2019-06-14 17:54 ` Suzuki K Poulose
  2019-06-14 20:31   ` Wolfram Sang
  2019-06-14 17:54 ` [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper Suzuki K Poulose
  2019-06-24  3:23 ` [PATCH v2 00/28] drivers: Consolidate device lookup helpers Greg KH
  2 siblings, 1 reply; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-14 17:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, rafael, suzuki.poulose, Alan Tull, Andrew Lunn,
	Daniel Vetter, David Airlie, David S. Miller, devicetree,
	dri-devel, Florian Fainelli, Frank Rowand, Heiner Kallweit,
	Jiri Slaby, Jonathan Hunter, Lee Jones, Liam Girdwood, linux-fpga,
	linux-i2c, linux-spi, Maarten Lankhorst, Mark Brown,
	Mathieu Poirier, Maxime Ripard, Moritz Fischer, Peter Rosin,
	Rob Herring, Srinivas Kandagatla, Thierry Reding, Thor Thayer,
	Wolfram Sang, Ulf Hansson, Joe Perches

Add a helper to match device by the of_node. This will be later used
to provide wrappers to the device iterators for {bus/class/driver}_find_device().
Convert other users to reuse this new helper.

Cc: Alan Tull <atull@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: devicetree@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: linux-fpga@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-spi@vger.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Moritz Fischer <mdf@kernel.org>
Cc: Peter Rosin <peda@axentia.se>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thor Thayer <thor.thayer@linux.intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/base/core.c           | 6 ++++++
 drivers/fpga/of-fpga-region.c | 7 +------
 include/linux/device.h        | 2 ++
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index fd7511e..9211908 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3328,3 +3328,9 @@ void device_set_of_node_from_dev(struct device *dev, const struct device *dev2)
 	dev->of_node_reused = true;
 }
 EXPORT_SYMBOL_GPL(device_set_of_node_from_dev);
+
+int device_match_of_node(struct device *dev, const void *np)
+{
+	return dev->of_node == np;
+}
+EXPORT_SYMBOL_GPL(device_match_of_node);
diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 75f64ab..e405309 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -22,11 +22,6 @@ static const struct of_device_id fpga_region_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, fpga_region_of_match);
 
-static int fpga_region_of_node_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 /**
  * of_fpga_region_find - find FPGA region
  * @np: device node of FPGA Region
@@ -37,7 +32,7 @@ static int fpga_region_of_node_match(struct device *dev, const void *data)
  */
 static struct fpga_region *of_fpga_region_find(struct device_node *np)
 {
-	return fpga_region_class_find(NULL, np, fpga_region_of_node_match);
+	return fpga_region_class_find(NULL, np, device_match_of_node);
 }
 
 /**
diff --git a/include/linux/device.h b/include/linux/device.h
index 4d7c881..7093085 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -163,6 +163,8 @@ void subsys_dev_iter_init(struct subsys_dev_iter *iter,
 struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
 void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
 
+int device_match_of_node(struct device *dev, const void *np);
+
 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
 		     int (*fn)(struct device *dev, void *data));
 struct device *bus_find_device(struct bus_type *bus, struct device *start,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper
  2019-06-14 17:53 [PATCH v2 00/28] drivers: Consolidate device lookup helpers Suzuki K Poulose
  2019-06-14 17:54 ` [PATCH v2 06/28] drivers: Add generic helper to match by of_node Suzuki K Poulose
@ 2019-06-14 17:54 ` Suzuki K Poulose
  2019-06-22  5:25   ` Peter Rosin
  2019-06-24  3:23 ` [PATCH v2 00/28] drivers: Consolidate device lookup helpers Greg KH
  2 siblings, 1 reply; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-14 17:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, rafael, suzuki.poulose, Alan Tull, Moritz Fischer,
	linux-fpga, Peter Rosin, Mark Brown, Florian Fainelli,
	Heiner Kallweit, David S. Miller, Andrew Lunn, Liam Girdwood,
	Jiri Slaby

Add a wrapper to class_find_device() to search for a device
by the of_node pointer, reusing the generic match function.
Also convert the existing users to make use of the new helper.

Cc: Alan Tull <atull@kernel.org>
Cc: Moritz Fischer <mdf@kernel.org>
Cc: linux-fpga@vger.kernel.org
Cc: Peter Rosin <peda@axentia.se>
Cc: Mark Brown <broonie@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Jiri Slaby <jslaby@suse.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/fpga/fpga-bridge.c       |  8 +-------
 drivers/fpga/fpga-mgr.c          |  8 +-------
 drivers/mux/core.c               |  7 +------
 drivers/net/phy/mdio_bus.c       |  9 +--------
 drivers/regulator/of_regulator.c |  7 +------
 drivers/spi/spi.c                | 11 ++---------
 include/linux/device.h           | 12 ++++++++++++
 7 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 80bd8f1..4bab902 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -19,11 +19,6 @@ static struct class *fpga_bridge_class;
 /* Lock for adding/removing bridges to linked lists*/
 static spinlock_t bridge_list_lock;
 
-static int fpga_bridge_of_node_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 /**
  * fpga_bridge_enable - Enable transactions on the bridge
  *
@@ -104,8 +99,7 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
 {
 	struct device *dev;
 
-	dev = class_find_device(fpga_bridge_class, NULL, np,
-				fpga_bridge_of_node_match);
+	dev = class_find_device_by_of_node(fpga_bridge_class, np);
 	if (!dev)
 		return ERR_PTR(-ENODEV);
 
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index c386681..e05104f 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -482,11 +482,6 @@ struct fpga_manager *fpga_mgr_get(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(fpga_mgr_get);
 
-static int fpga_mgr_of_node_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 /**
  * of_fpga_mgr_get - Given a device node, get a reference to a fpga mgr.
  *
@@ -498,8 +493,7 @@ struct fpga_manager *of_fpga_mgr_get(struct device_node *node)
 {
 	struct device *dev;
 
-	dev = class_find_device(fpga_mgr_class, NULL, node,
-				fpga_mgr_of_node_match);
+	dev = class_find_device_by_of_node(fpga_mgr_class, node);
 	if (!dev)
 		return ERR_PTR(-ENODEV);
 
diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index d1271c1..1fb2238 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -405,17 +405,12 @@ int mux_control_deselect(struct mux_control *mux)
 }
 EXPORT_SYMBOL_GPL(mux_control_deselect);
 
-static int of_dev_node_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 /* Note this function returns a reference to the mux_chip dev. */
 static struct mux_chip *of_find_mux_chip_by_node(struct device_node *np)
 {
 	struct device *dev;
 
-	dev = class_find_device(&mux_class, NULL, np, of_dev_node_match);
+	dev = class_find_device_by_of_node(&mux_class, np);
 
 	return dev ? to_mux_chip(dev) : NULL;
 }
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index bd04fe7..ce94087 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -262,11 +262,6 @@ static struct class mdio_bus_class = {
 };
 
 #if IS_ENABLED(CONFIG_OF_MDIO)
-/* Helper function for of_mdio_find_bus */
-static int of_mdio_bus_match(struct device *dev, const void *mdio_bus_np)
-{
-	return dev->of_node == mdio_bus_np;
-}
 /**
  * of_mdio_find_bus - Given an mii_bus node, find the mii_bus.
  * @mdio_bus_np: Pointer to the mii_bus.
@@ -287,9 +282,7 @@ struct mii_bus *of_mdio_find_bus(struct device_node *mdio_bus_np)
 	if (!mdio_bus_np)
 		return NULL;
 
-	d = class_find_device(&mdio_bus_class, NULL,  mdio_bus_np,
-			      of_mdio_bus_match);
-
+	d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np);
 	return d ? to_mii_bus(d) : NULL;
 }
 EXPORT_SYMBOL(of_mdio_find_bus);
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 0ead116..1b40277 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -442,16 +442,11 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
 	return NULL;
 }
 
-static int of_node_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 struct regulator_dev *of_find_regulator_by_node(struct device_node *np)
 {
 	struct device *dev;
 
-	dev = class_find_device(&regulator_class, NULL, np, of_node_match);
+	dev = class_find_device_by_of_node(&regulator_class, np);
 
 	return dev ? dev_to_rdev(dev) : NULL;
 }
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3da1121..a256be5 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3554,21 +3554,14 @@ EXPORT_SYMBOL_GPL(of_find_spi_device_by_node);
 #endif /* IS_ENABLED(CONFIG_OF) */
 
 #if IS_ENABLED(CONFIG_OF_DYNAMIC)
-static int __spi_of_controller_match(struct device *dev, const void *data)
-{
-	return dev->of_node == data;
-}
-
 /* the spi controllers are not using spi_bus, so we find it with another way */
 static struct spi_controller *of_find_spi_controller_by_node(struct device_node *node)
 {
 	struct device *dev;
 
-	dev = class_find_device(&spi_master_class, NULL, node,
-				__spi_of_controller_match);
+	dev = class_find_device_by_of_node(&spi_master_class, node);
 	if (!dev && IS_ENABLED(CONFIG_SPI_SLAVE))
-		dev = class_find_device(&spi_slave_class, NULL, node,
-					__spi_of_controller_match);
+		dev = class_find_device_by_of_node(&spi_slave_class, node);
 	if (!dev)
 		return NULL;
 
diff --git a/include/linux/device.h b/include/linux/device.h
index bb14c7f..9228502 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -497,6 +497,18 @@ static inline struct device *class_find_device_by_name(struct class *class,
 	return class_find_device(class, NULL, name, device_match_name);
 }
 
+/**
+ * class_find_device_by_of_node : device iterator for locating a particular device
+ * matching the of_node.
+ * @class: class type
+ * @np: of_node of the device to match.
+ */
+static inline struct device *
+class_find_device_by_of_node(struct class *class, const struct device_node *np)
+{
+	return class_find_device(class, NULL, np, device_match_of_node);
+}
+
 struct class_attribute {
 	struct attribute attr;
 	ssize_t (*show)(struct class *class, struct class_attribute *attr,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 06/28] drivers: Add generic helper to match by of_node
  2019-06-14 17:54 ` [PATCH v2 06/28] drivers: Add generic helper to match by of_node Suzuki K Poulose
@ 2019-06-14 20:31   ` Wolfram Sang
  2019-06-17  9:59     ` Suzuki K Poulose
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfram Sang @ 2019-06-14 20:31 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, gregkh, rafael, Alan Tull, Andrew Lunn,
	Daniel Vetter, David Airlie, David S. Miller, devicetree,
	dri-devel, Florian Fainelli, Frank Rowand, Heiner Kallweit,
	Jiri Slaby, Jonathan Hunter, Lee Jones, Liam Girdwood, linux-fpga,
	linux-i2c, linux-spi, Maarten Lankhorst, Mark Brown,
	Mathieu Poirier, Maxime Ripard, Moritz Fischer, Peter Rosin,
	Rob Herring, Srinivas Kandagatla, Thierry Reding, Thor Thayer,
	Ulf Hansson, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

> +
> +int device_match_of_node(struct device *dev, const void *np)
> +{
> +	return dev->of_node == np;
> +}
> +EXPORT_SYMBOL_GPL(device_match_of_node);

Is it an option to 'static inline' this simple function in the header,
saving the EXPORT?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 06/28] drivers: Add generic helper to match by of_node
  2019-06-14 20:31   ` Wolfram Sang
@ 2019-06-17  9:59     ` Suzuki K Poulose
  2019-06-17 10:06       ` Wolfram Sang
  0 siblings, 1 reply; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-17  9:59 UTC (permalink / raw)
  To: wsa
  Cc: linux-kernel, gregkh, rafael, atull, andrew, daniel, airlied,
	davem, devicetree, dri-devel, f.fainelli, frowand.list,
	hkallweit1, jslaby, jonathanh, lee.jones, lgirdwood, linux-fpga,
	linux-i2c, linux-spi, maarten.lankhorst, broonie, mathieu.poirier,
	maxime.ripard, mdf, peda, robh+dt, srinivas.kandagatla,
	thierry.reding, thor.thayer, ulf.hansson, joe

Hi

On 14/06/2019 21:31, Wolfram Sang wrote:
>> +
>> +int device_match_of_node(struct device *dev, const void *np)
>> +{
>> +	return dev->of_node == np;
>> +}
>> +EXPORT_SYMBOL_GPL(device_match_of_node);
> 
> Is it an option to 'static inline' this simple function in the header,
> saving the EXPORT?
> 

No. This is supposed to be passed on as a call back function pointer
for the APIs. Having it as a static inline, would simply replicate
the same function through the driver subsystems, which is one of the
issues that series is trying to solve. Also, by having them exported,
we can convert the new specialized device lookup functions,
*_find_device_by_<property> to be static inlines.

Suzuki

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 06/28] drivers: Add generic helper to match by of_node
  2019-06-17  9:59     ` Suzuki K Poulose
@ 2019-06-17 10:06       ` Wolfram Sang
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2019-06-17 10:06 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, gregkh, rafael, atull, andrew, daniel, airlied,
	davem, devicetree, dri-devel, f.fainelli, frowand.list,
	hkallweit1, jslaby, jonathanh, lee.jones, lgirdwood, linux-fpga,
	linux-i2c, linux-spi, maarten.lankhorst, broonie, mathieu.poirier,
	maxime.ripard, mdf, peda, robh+dt, srinivas.kandagatla,
	thierry.reding, thor.thayer, ulf.hansson, joe

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]


> > Is it an option to 'static inline' this simple function in the header,
> > saving the EXPORT?
> > 
> 
> No.

OK, thanks for the explanation!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper
  2019-06-14 17:54 ` [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper Suzuki K Poulose
@ 2019-06-22  5:25   ` Peter Rosin
  2019-06-24  8:34     ` Suzuki K Poulose
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Rosin @ 2019-06-22  5:25 UTC (permalink / raw)
  To: Suzuki K Poulose, linux-kernel@vger.kernel.org
  Cc: gregkh@linuxfoundation.org, rafael@kernel.org, Alan Tull,
	Moritz Fischer, linux-fpga@vger.kernel.org, Mark Brown,
	Florian Fainelli, Heiner Kallweit, David S. Miller, Andrew Lunn,
	Liam Girdwood, Jiri Slaby

On 2019-06-14 19:54, Suzuki K Poulose wrote:
> Add a wrapper to class_find_device() to search for a device
> by the of_node pointer, reusing the generic match function.
> Also convert the existing users to make use of the new helper.
> 
> Cc: Alan Tull <atull@kernel.org>
> Cc: Moritz Fischer <mdf@kernel.org>
> Cc: linux-fpga@vger.kernel.org
> Cc: Peter Rosin <peda@axentia.se>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Jiri Slaby <jslaby@suse.com>
> Acked-by: Mark Brown <broonie@kernel.org>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Peter Rosin <peda@axentia.se>

Whoooa! I reviewed only the drivers/mux/core.c changes when this was done
in a series of much smaller patches. This tag makes it seem as if I have
reviewed the whole thing, which I had not done when you added this tag out
of the blue.

Now, this stuff is trivial and by now I have looked at the other files
and it all seems simple enough. So, you can keep the tag, but it is NOT
ok to handle tags like you have done here.

Cheers,
Peter

> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/fpga/fpga-bridge.c       |  8 +-------
>  drivers/fpga/fpga-mgr.c          |  8 +-------
>  drivers/mux/core.c               |  7 +------
>  drivers/net/phy/mdio_bus.c       |  9 +--------
>  drivers/regulator/of_regulator.c |  7 +------
>  drivers/spi/spi.c                | 11 ++---------
>  include/linux/device.h           | 12 ++++++++++++
>  7 files changed, 19 insertions(+), 43 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 00/28] drivers: Consolidate device lookup helpers
  2019-06-14 17:53 [PATCH v2 00/28] drivers: Consolidate device lookup helpers Suzuki K Poulose
  2019-06-14 17:54 ` [PATCH v2 06/28] drivers: Add generic helper to match by of_node Suzuki K Poulose
  2019-06-14 17:54 ` [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper Suzuki K Poulose
@ 2019-06-24  3:23 ` Greg KH
  2 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2019-06-24  3:23 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, rafael, Alan Tull, Alessandro Zummo,
	Alexander Aring, Alexander Shishkin, Alexandre Belloni,
	Andreas Noever, Andrew Lunn, Arnd Bergmann, Bjorn Helgaas,
	Corey Minyard, Daniel Vetter, Dan Murphy, David Airlie,
	David Kershner, David S. Miller, Doug Ledford, dri-devel,
	Elie Morisse, Eric Anholt, Felipe Balbi, Florian Fainelli,
	Frank Rowand, Grant Likely, Grygorii Strashko,
	Harald Freudenberger, Hartmut Knaack, Heikki Krogerus,
	Heiko Carstens, Heiko Stübner, Heiner Kallweit, Inki Dae,
	Jacek Anaszewski, James E.J. Bottomley, Jason Gunthorpe,
	Jiri Slaby, Joe Perches, Joerg Roedel, Jonathan Cameron,
	Jonathan Hunter, Lee Jones, Len Brown, Liam Girdwood,
	Maarten Lankhorst, Mark Brown, Martin K. Petersen,
	Mathieu Poirier, Maxime Coquelin, Maxime Ripard, Michael Jamet,
	Mika Westerberg, Moritz Fischer, Nehal Shah, Oliver Neukum,
	Pavel Machek, Peter Oberparleiter, Peter Rosin, Rafael J. Wysocki,
	Rafael J . Wysocki , Rob Herring, Robin Murphy, Russell King,
	Sandy Huang, Sebastian Andrzej Siewior, Sebastian Ott,
	Seung-Woo Kim, Shyam Sundar S K, Srinivas Kandagatla,
	Stefan Schmidt, Takashi Iwai, Thierry Reding, Thor Thayer,
	Tomas Winkler, Ulf Hansson, Will Deacon, Wolfram Sang, devicetree,
	linux-acpi, linux-fpga, linux-i2c, linux-leds, linux-rockchip,
	linux-rtc, linux-spi, linux-usb, linux-wpan

On Fri, Jun 14, 2019 at 06:53:55PM +0100, Suzuki K Poulose wrote:
> We have device iterators to find a particular device matching a criteria
> for a given bus/class/driver. i.e, {bus,class,driver}_find_device() APIs.
> The matching criteria is a function pointer for the APIs. Often the lookup
> is based on a generic property of a device (e.g, name, fwnode, of node pointer
> or device type) rather than a driver specific information. However, each driver
> writes up its own "match" function, spilling the similar match functions all
> over the driver subsystems.
> 
> Additionally the prototype for the "match" functions accepted by the above APIs
> have a minute difference which prevents us otherwise sharing the match functions.
> i.e,
> 	int (*match)(struct device *dev, void *data) for {bus/driver}_find_device()
> 	  vs
> 	int (*match)(struct device *dev, const void *) for class_find_device()
> 
> If we promote the former to accept a "const void*" parameter, we could share one
> single match function for all the helpers. This series achieves the following:
> 
>  a) [Patches 03-05] Unify the prototype for "match" functions accepted by the
>      device lookup APIs.

I've applied the first 6 patches of this series to my tree now.  Let's
see how that goes, and this should give you a more solid base to redo
the rest of the series off of.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper
  2019-06-22  5:25   ` Peter Rosin
@ 2019-06-24  8:34     ` Suzuki K Poulose
  2019-06-24 14:07       ` Peter Rosin
  0 siblings, 1 reply; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-24  8:34 UTC (permalink / raw)
  To: peda, linux-kernel
  Cc: gregkh, rafael, atull, mdf, linux-fpga, broonie, f.fainelli,
	hkallweit1, davem, andrew, lgirdwood, jslaby

Hi Peter,

On 22/06/2019 06:25, Peter Rosin wrote:
> On 2019-06-14 19:54, Suzuki K Poulose wrote:
>> Add a wrapper to class_find_device() to search for a device
>> by the of_node pointer, reusing the generic match function.
>> Also convert the existing users to make use of the new helper.
>>
>> Cc: Alan Tull <atull@kernel.org>
>> Cc: Moritz Fischer <mdf@kernel.org>
>> Cc: linux-fpga@vger.kernel.org
>> Cc: Peter Rosin <peda@axentia.se>
>> Cc: Mark Brown <broonie@kernel.org>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: Liam Girdwood <lgirdwood@gmail.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
>> Cc: Jiri Slaby <jslaby@suse.com>
>> Acked-by: Mark Brown <broonie@kernel.org>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>> Reviewed-by: Peter Rosin <peda@axentia.se>
> 
> Whoooa! I reviewed only the drivers/mux/core.c changes when this was done
> in a series of much smaller patches. This tag makes it seem as if I have
> reviewed the whole thing, which I had not done when you added this tag out
> of the blue.

Apologies for the surprise. The patch was simply squashed with the change that
introduced the "helper" to better aid the reviewers, based on suggestions on the
list. I kept your tags, only because there were no changes, but some additional
context on the core driver.

> 
> Now, this stuff is trivial and by now I have looked at the other files
> and it all seems simple enough. So, you can keep the tag, but it is NOT
> ok to handle tags like you have done here.

Sure, I will keep that in mind.

Cheers
Suzuki

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper
  2019-06-24  8:34     ` Suzuki K Poulose
@ 2019-06-24 14:07       ` Peter Rosin
  2019-06-24 15:19         ` Suzuki K Poulose
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Rosin @ 2019-06-24 14:07 UTC (permalink / raw)
  To: Suzuki K Poulose, linux-kernel@vger.kernel.org
  Cc: gregkh@linuxfoundation.org, rafael@kernel.org, atull@kernel.org,
	mdf@kernel.org, linux-fpga@vger.kernel.org, broonie@kernel.org,
	f.fainelli@gmail.com, hkallweit1@gmail.com, davem@davemloft.net,
	andrew@lunn.ch, lgirdwood@gmail.com, jslaby@suse.com

On 2019-06-24 10:34, Suzuki K Poulose wrote:
> Hi Peter,
> 
> On 22/06/2019 06:25, Peter Rosin wrote:
>> On 2019-06-14 19:54, Suzuki K Poulose wrote:
>>> Add a wrapper to class_find_device() to search for a device
>>> by the of_node pointer, reusing the generic match function.
>>> Also convert the existing users to make use of the new helper.
>>>
>>> Cc: Alan Tull <atull@kernel.org>
>>> Cc: Moritz Fischer <mdf@kernel.org>
>>> Cc: linux-fpga@vger.kernel.org
>>> Cc: Peter Rosin <peda@axentia.se>
>>> Cc: Mark Brown <broonie@kernel.org>
>>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>>> Cc: "David S. Miller" <davem@davemloft.net>
>>> Cc: Andrew Lunn <andrew@lunn.ch>
>>> Cc: Liam Girdwood <lgirdwood@gmail.com>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
>>> Cc: Jiri Slaby <jslaby@suse.com>
>>> Acked-by: Mark Brown <broonie@kernel.org>
>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>> Reviewed-by: Peter Rosin <peda@axentia.se>
>>
>> Whoooa! I reviewed only the drivers/mux/core.c changes when this was done
>> in a series of much smaller patches. This tag makes it seem as if I have
>> reviewed the whole thing, which I had not done when you added this tag out
>> of the blue.
> 
> Apologies for the surprise. The patch was simply squashed with the change that
> introduced the "helper" to better aid the reviewers, based on suggestions on the
> list. I kept your tags, only because there were no changes, but some additional
> context on the core driver.

You could e.g. have written:

	...
	[For the drivers/mux/core.c part]
	Reviewed-by: Peter Rosin <peda@axentia.se>
	...

>>
>> Now, this stuff is trivial and by now I have looked at the other files
>> and it all seems simple enough. So, you can keep the tag, but it is NOT
>> ok to handle tags like you have done here.
> 
> Sure, I will keep that in mind.

Great!

Cheers,
Peter

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper
  2019-06-24 14:07       ` Peter Rosin
@ 2019-06-24 15:19         ` Suzuki K Poulose
  0 siblings, 0 replies; 11+ messages in thread
From: Suzuki K Poulose @ 2019-06-24 15:19 UTC (permalink / raw)
  To: peda, linux-kernel
  Cc: gregkh, rafael, atull, mdf, linux-fpga, broonie, f.fainelli,
	hkallweit1, davem, andrew, lgirdwood, jslaby



On 24/06/2019 15:07, Peter Rosin wrote:
> On 2019-06-24 10:34, Suzuki K Poulose wrote:
>> Hi Peter,
>>
>> On 22/06/2019 06:25, Peter Rosin wrote:
>>> On 2019-06-14 19:54, Suzuki K Poulose wrote:
>>>> Add a wrapper to class_find_device() to search for a device
>>>> by the of_node pointer, reusing the generic match function.
>>>> Also convert the existing users to make use of the new helper.
>>>>
>>>> Cc: Alan Tull <atull@kernel.org>
>>>> Cc: Moritz Fischer <mdf@kernel.org>
>>>> Cc: linux-fpga@vger.kernel.org
>>>> Cc: Peter Rosin <peda@axentia.se>
>>>> Cc: Mark Brown <broonie@kernel.org>
>>>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>>>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>>>> Cc: "David S. Miller" <davem@davemloft.net>
>>>> Cc: Andrew Lunn <andrew@lunn.ch>
>>>> Cc: Liam Girdwood <lgirdwood@gmail.com>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
>>>> Cc: Jiri Slaby <jslaby@suse.com>
>>>> Acked-by: Mark Brown <broonie@kernel.org>
>>>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>>>> Reviewed-by: Peter Rosin <peda@axentia.se>
>>>
>>> Whoooa! I reviewed only the drivers/mux/core.c changes when this was done
>>> in a series of much smaller patches. This tag makes it seem as if I have
>>> reviewed the whole thing, which I had not done when you added this tag out
>>> of the blue.
>>
>> Apologies for the surprise. The patch was simply squashed with the change that
>> introduced the "helper" to better aid the reviewers, based on suggestions on the
>> list. I kept your tags, only because there were no changes, but some additional
>> context on the core driver.
> 
> You could e.g. have written:
> 
> 	...
> 	[For the drivers/mux/core.c part]
> 	Reviewed-by: Peter Rosin <peda@axentia.se>
> 	...

Ok. This might change again, another level of merging, but no changes to the
hunk for mux. So I can use the above.

Cheers
Suzuki

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-06-24 15:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14 17:53 [PATCH v2 00/28] drivers: Consolidate device lookup helpers Suzuki K Poulose
2019-06-14 17:54 ` [PATCH v2 06/28] drivers: Add generic helper to match by of_node Suzuki K Poulose
2019-06-14 20:31   ` Wolfram Sang
2019-06-17  9:59     ` Suzuki K Poulose
2019-06-17 10:06       ` Wolfram Sang
2019-06-14 17:54 ` [PATCH v2 13/28] drivers: Introduce class_find_device_by_of_node() helper Suzuki K Poulose
2019-06-22  5:25   ` Peter Rosin
2019-06-24  8:34     ` Suzuki K Poulose
2019-06-24 14:07       ` Peter Rosin
2019-06-24 15:19         ` Suzuki K Poulose
2019-06-24  3:23 ` [PATCH v2 00/28] drivers: Consolidate device lookup helpers Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).