Linux-m68k Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/5] zorro: Miscellaneous cleanups
@ 2020-01-12 16:49 Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 1/5] zorro: Make zorro_match_device() static Geert Uytterhoeven
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

	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(-)

-- 
2.17.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* [PATCH 1/5] zorro: Make zorro_match_device() static
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
@ 2020-01-12 16:49 ` Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 2/5] zorro: Fix zorro_bus_match() kerneldoc Geert Uytterhoeven
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

Unlike its PCI counterpart, zorro_match_device() was never used outside
the Zorro bus code.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/zorro/zorro-driver.c | 3 +--
 include/linux/zorro.h        | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
index fa23b7366b98ccbe..84ac94aecb7966b8 100644
--- a/drivers/zorro/zorro-driver.c
+++ b/drivers/zorro/zorro-driver.c
@@ -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)
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 63fbba0740c2c2bf..cb72515b0ac17040 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -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;
-- 
2.17.1


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

* [PATCH 2/5] zorro: Fix zorro_bus_match() kerneldoc
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 1/5] zorro: Make zorro_match_device() static Geert Uytterhoeven
@ 2020-01-12 16:49 ` Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 3/5] zorro: Use zorro_match_device() helper in zorro_bus_match() Geert Uytterhoeven
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

The kerneldoc for zorro_bus_match() was obviously copied from
zorro_match_device(), but wasnt't updated for the different calling
context and semantics.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/zorro/zorro-driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
index 84ac94aecb7966b8..67e68880554245e1 100644
--- a/drivers/zorro/zorro-driver.c
+++ b/drivers/zorro/zorro-driver.c
@@ -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)
-- 
2.17.1


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

* [PATCH 3/5] zorro: Use zorro_match_device() helper in zorro_bus_match()
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 1/5] zorro: Make zorro_match_device() static Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 2/5] zorro: Fix zorro_bus_match() kerneldoc Geert Uytterhoeven
@ 2020-01-12 16:49 ` Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 4/5] zorro: Remove unused zorro_dev_driver() Geert Uytterhoeven
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

Make zorro_bus_match() use the existing zorro_match_device() helper,
instead of open-coding the same operation.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/zorro/zorro-driver.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c
index 67e68880554245e1..0dd7cbcec2b0d478 100644
--- a/drivers/zorro/zorro-driver.c
+++ b/drivers/zorro/zorro-driver.c
@@ -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)
-- 
2.17.1


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

* [PATCH 4/5] zorro: Remove unused zorro_dev_driver()
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2020-01-12 16:49 ` [PATCH 3/5] zorro: Use zorro_match_device() helper in zorro_bus_match() Geert Uytterhoeven
@ 2020-01-12 16:49 ` Geert Uytterhoeven
  2020-01-12 16:49 ` [PATCH 5/5] zorro: Move zorro_bus_type to bus-private header file Geert Uytterhoeven
  2020-02-10 11:16 ` [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

This function was never used.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/linux/zorro.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index cb72515b0ac17040..22f3f80fbcb5afe6 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -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 */
-- 
2.17.1


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

* [PATCH 5/5] zorro: Move zorro_bus_type to bus-private header file
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2020-01-12 16:49 ` [PATCH 4/5] zorro: Remove unused zorro_dev_driver() Geert Uytterhoeven
@ 2020-01-12 16:49 ` Geert Uytterhoeven
  2020-02-10 11:16 ` [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-01-12 16:49 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

zorro_bus_type was never used outside the Zorro bus code.  Hence move it
from the public to the bus-private header file.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/zorro/zorro.h | 7 +++++++
 include/linux/zorro.h | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h
index ac0bab3412d90ddb..f84df9fb4c200ec3 100644
--- a/drivers/zorro/zorro.h
+++ b/drivers/zorro/zorro.h
@@ -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
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 22f3f80fbcb5afe6..e2e4de188d84a6d9 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -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
      */
-- 
2.17.1


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

* Re: [PATCH 0/5] zorro: Miscellaneous cleanups
  2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2020-01-12 16:49 ` [PATCH 5/5] zorro: Move zorro_bus_type to bus-private header file Geert Uytterhoeven
@ 2020-02-10 11:16 ` Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-02-10 11:16 UTC (permalink / raw)
  To: linux-m68k; +Cc: Linux Kernel Mailing List

On Sun, Jan 12, 2020 at 5:49 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> 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

Thanks, applied and queued for v5.7.


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-12 16:49 [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven
2020-01-12 16:49 ` [PATCH 1/5] zorro: Make zorro_match_device() static Geert Uytterhoeven
2020-01-12 16:49 ` [PATCH 2/5] zorro: Fix zorro_bus_match() kerneldoc Geert Uytterhoeven
2020-01-12 16:49 ` [PATCH 3/5] zorro: Use zorro_match_device() helper in zorro_bus_match() Geert Uytterhoeven
2020-01-12 16:49 ` [PATCH 4/5] zorro: Remove unused zorro_dev_driver() Geert Uytterhoeven
2020-01-12 16:49 ` [PATCH 5/5] zorro: Move zorro_bus_type to bus-private header file Geert Uytterhoeven
2020-02-10 11:16 ` [PATCH 0/5] zorro: Miscellaneous cleanups Geert Uytterhoeven

Linux-m68k Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-m68k/0 linux-m68k/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-m68k linux-m68k/ https://lore.kernel.org/linux-m68k \
		linux-m68k@vger.kernel.org linux-m68k@lists.linux-m68k.org
	public-inbox-index linux-m68k

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-m68k


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git