zorro: Miscellaneous cleanups
Geert Uytterhoeven
maintainercover zorro: Miscellaneous cleanups
Hi all,
This patch series contains miscellaneous cleanups for the Zorro bus code.
Geert Uytterhoeven (5):
zorro: Make zorro_match_device() static
zorro: Fix zorro_bus_match() kerneldoc
zorro: Use zorro_match_device() helper in zorro_bus_match()
zorro: Remove unused zorro_dev_driver()
zorro: Move zorro_bus_type to bus-private header file
drivers/zorro/zorro-driver.c | 16 +++++----------- drivers/zorro/zorro.h | 7 +++++++ include/linux/zorro.h | 12 ------------ 3 files changed, 12 insertions(+), 23 deletions(-)
Signature · 12 lines
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsGeert Uytterhoeven
maintainerPATCH 1/5 zorro: Make zorro_match_device() static
Unlike its PCI counterpart, zorro_match_device() was never used outside the Zorro bus code.
--- drivers/zorro/zorro-driver.c | 3 +-- include/linux/zorro.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/zorro/zorro-driver.c +1 -2
@@ -28,7 +28,7 @@* zorro_device_id structure or %NULL if there is no match. */ -const struct zorro_device_id * +static const struct zorro_device_id *zorro_match_device (const struct zorro_device_id *ids,const struct zorro_dev *z) {
@@ -39,7 +39,6 @@ zorro_match_device(const struct zorro_device_id *ids, }return NULL ; } -EXPORT_SYMBOL (zorro_match_device);static int zorro_device_probe (struct device *dev)
include/linux/zorro.h +0 -1
@@ -70,7 +70,6 @@ struct zorro_driver {/* New-style probing */ extern int zorro_register_driver (struct zorro_driver *);extern void zorro_unregister_driver (struct zorro_driver *); -extern const struct zorro_device_id *zorro_match_device (const struct zorro_device_id *ids,const struct zorro_dev *z);static inline struct zorro_driver *zorro_dev_driver (const struct zorro_dev *z) {return z->driver;
Signature · 1 line
2.17.1
Geert Uytterhoeven
maintainerPATCH 2/5 zorro: Fix zorro_bus_match() kerneldoc
In reply to Geert UytterhoevenThe kerneldoc for zorro_bus_match() was obviously copied from zorro_match_device(), but wasnt't updated for the different calling context and semantics.
--- drivers/zorro/zorro-driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/zorro/zorro-driver.c +3 -3
@@ -119,9 +119,9 @@ EXPORT_SYMBOL(zorro_unregister_driver);* @ids: array of Zorro device id structures to search in * @dev: the Zorro device structure to match against * -* Used by a driver to check whether a Zorro device present in the -* system is in its list of supported devices.Returns the matching -* zorro_device_id structure or %NULL if there is no match. +* Used by the driver core to check whether a Zorro device present in the +* system is in a driver's list of supported devices. Returns 1 if +* supported, and 0 if there is no match. */ static int zorro_bus_match (struct device *dev,struct device_driver *drv)
Signature · 1 line
2.17.1
Geert Uytterhoeven
maintainerPATCH 3/5 zorro: Use zorro_match_device() helper in zorro_bus_match()
In reply to Geert UytterhoevenMake zorro_bus_match() use the existing zorro_match_device() helper, instead of open-coding the same operation.
--- drivers/zorro/zorro-driver.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/zorro/zorro-driver.c +1 -6
@@ -133,12 +133,7 @@ static int zorro_bus_match(struct device *dev, struct device_driver *drv)if (!ids)return 0 ; -while (ids->id) { -if (ids->id ==ZORRO_WILDCARD || ids->id == z->id) -return 1 ; - ids++; - } -return 0 ; +return !!zorro_match_device (ids, z); }static int zorro_uevent (struct device *dev,struct kobj_uevent_env *env)
Signature · 1 line
2.17.1
Geert Uytterhoeven
maintainerPATCH 4/5 zorro: Remove unused zorro_dev_driver()
In reply to Geert UytterhoevenThis function was never used.
--- include/linux/zorro.h | 4 ---- 1 file changed, 4 deletions(-)
include/linux/zorro.h +0 -4
@@ -70,10 +70,6 @@ struct zorro_driver {/* New-style probing */ extern int zorro_register_driver (struct zorro_driver *);extern void zorro_unregister_driver (struct zorro_driver *); -static inline struct zorro_driver *zorro_dev_driver (const struct zorro_dev *z) -{ -return z->driver; -}extern unsigned int zorro_num_autocon;/* # of autoconfig devices found */
Signature · 1 line
2.17.1
Geert Uytterhoeven
maintainerPATCH 5/5 zorro: Move zorro_bus_type to bus-private header file
In reply to Geert Uytterhoevenzorro_bus_type was never used outside the Zorro bus code. Hence move it from the public to the bus-private header file.
--- drivers/zorro/zorro.h | 7 +++++++ include/linux/zorro.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/zorro/zorro.h +7 -0
@@ -1,5 +1,12 @@/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Zorro bus +*/ + +extern struct bus_type zorro_bus_type; + +#ifdef CONFIG_ZORRO_NAMES extern void zorro_name_device (struct zorro_dev *z);#else
include/linux/zorro.h +0 -7
@@ -40,13 +40,6 @@ struct zorro_dev {#define to_zorro_dev (n) container_of(n, struct zorro_dev, dev) -/* -* Zorro bus -*/ - -extern struct bus_type zorro_bus_type; - -/* * Zorro device drivers */
Signature · 1 line
2.17.1
Quoted 9 lines · Geert Uytterhoeven
This patch series contains miscellaneous cleanups for the Zorro bus code.
Geert Uytterhoeven (5):
zorro: Makezorro_match_device()static
zorro: Fixzorro_bus_match()kerneldoc
zorro: Usezorro_match_device()helper inzorro_bus_match()
zorro: Remove unusedzorro_dev_driver()
zorro: Movezorro_bus_typeto bus-private header file
Thanks, applied and queued for v5.7.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds