From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-m68k@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 4/8] zorro: Refactor conditional handling of Zorro device name database
Date: Wed, 16 Oct 2013 13:03:21 +0200 [thread overview]
Message-ID: <1381921405-11206-5-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1381921405-11206-1-git-send-email-geert@linux-m68k.org>
Using an empty static inline function in the CONFIG_ZORRO_NAMES=n case
allows to drop compilation of names.c.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/zorro/Makefile | 3 ++-
drivers/zorro/names.c | 10 ----------
drivers/zorro/zorro.h | 5 +++++
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/zorro/Makefile b/drivers/zorro/Makefile
index f62172603215..7dc5332ff984 100644
--- a/drivers/zorro/Makefile
+++ b/drivers/zorro/Makefile
@@ -2,8 +2,9 @@
# Makefile for the Zorro bus specific drivers.
#
-obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o
+obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o
obj-$(CONFIG_PROC_FS) += proc.o
+obj-$(CONFIG_ZORRO_NAMES) += names.o
hostprogs-y := gen-devlist
diff --git a/drivers/zorro/names.c b/drivers/zorro/names.c
index e44e04c4f29d..6f3fd9903ac3 100644
--- a/drivers/zorro/names.c
+++ b/drivers/zorro/names.c
@@ -15,8 +15,6 @@
#include <linux/zorro.h>
-#ifdef CONFIG_ZORRO_NAMES
-
struct zorro_prod_info {
__u16 prod;
unsigned short seen;
@@ -97,11 +95,3 @@ void __init zorro_name_device(struct zorro_dev *dev)
}
}
}
-
-#else
-
-void __init zorro_name_device(struct zorro_dev *dev)
-{
-}
-
-#endif
diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h
index b682d5ccd63f..34119fb4e560 100644
--- a/drivers/zorro/zorro.h
+++ b/drivers/zorro/zorro.h
@@ -1,4 +1,9 @@
+#ifdef CONFIG_ZORRO_NAMES
extern void zorro_name_device(struct zorro_dev *z);
+#else
+static inline void zorro_name_device(struct zorro_dev *dev) { }
+#endif
+
extern int zorro_create_sysfs_dev_files(struct zorro_dev *z);
--
1.7.9.5
next prev parent reply other threads:[~2013-10-16 11:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 11:03 [PATCH 0/8] Amiga Zorro updates Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 1/8] Documentation/zorro.txt: Update path to arch-specific header files Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 2/8] zorro: Do not allocate zorro_autocon[] statically Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 3/8] zorro: Don't fill in dummy names in zorro_name_device() Geert Uytterhoeven
2013-10-16 11:03 ` Geert Uytterhoeven [this message]
2013-10-16 11:03 ` [PATCH 5/8] zorro: Let the driver core handle device enumeration Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 6/8] zorro: ZTWO_VADDR() should return "void __iomem *" Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 7/8] zorro/UAPI: Disintegrate include/linux/zorro*.h Geert Uytterhoeven
2013-10-16 11:03 ` [PATCH 8/8] zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h> Geert Uytterhoeven
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=1381921405-11206-5-git-send-email-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.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
all inboxes | Powered by JetHome®