From: Anisse Astier <anisse@astier.eu>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Michal Marek <mmarek@suse.cz>,
Linus Torvalds <torvalds@linux-foundation.org>,
Michael Chan <mchan@broadcom.com>,
Matt Carlson <mcarlson@broadcom.com>,
Anisse Astier <anisse@astier.eu>
Subject: [PATCH 2/2] tg3: fix build-time dependency with IS_DEPENDENCY_SATISFIED()
Date: Mon, 1 Oct 2012 14:21:20 +0200 [thread overview]
Message-ID: <1349094080-769-2-git-send-email-anisse@astier.eu> (raw)
In-Reply-To: <1349094080-769-1-git-send-email-anisse@astier.eu>
When CONFIG_TIGON3=y and CONFIG_HWMON=y, we will get this error:
LD init/built-in.o
drivers/built-in.o: In function `tg3_hwmon_open':
tg3.c:(.text+0xc1d12): undefined reference to `hwmon_device_register'
drivers/built-in.o: In function `tg3_close':
tg3.c:(.text+0xc2e7f): undefined reference to `hwmon_device_unregister'
make: *** [vmlinux] Error 1
Use the new IS_DEPENDENCY_SATISFIED() facility to solve this problem.
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
drivers/net/ethernet/broadcom/tg3.c | 8 ++++----
drivers/net/ethernet/broadcom/tg3.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index bf906c5..cc81a59 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -44,7 +44,7 @@
#include <linux/prefetch.h>
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_DEPENDENCY_SATISFIED(CONFIG_TIGON3, CONFIG_HWMON)
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#endif
@@ -9517,7 +9517,7 @@ static int tg3_init_hw(struct tg3 *tp, int reset_phy)
return tg3_reset_hw(tp, reset_phy);
}
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_DEPENDENCY_SATISFIED(CONFIG_TIGON3, CONFIG_HWMON)
static void tg3_sd_scan_scratchpad(struct tg3 *tp, struct tg3_ocir *ocir)
{
int i;
@@ -9574,7 +9574,7 @@ static const struct attribute_group tg3_group = {
static void tg3_hwmon_close(struct tg3 *tp)
{
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_DEPENDENCY_SATISFIED(CONFIG_TIGON3, CONFIG_HWMON)
if (tp->hwmon_dev) {
hwmon_device_unregister(tp->hwmon_dev);
tp->hwmon_dev = NULL;
@@ -9585,7 +9585,7 @@ static void tg3_hwmon_close(struct tg3 *tp)
static void tg3_hwmon_open(struct tg3 *tp)
{
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_DEPENDENCY_SATISFIED(CONFIG_TIGON3, CONFIG_HWMON)
int i, err;
u32 size = 0;
struct pci_dev *pdev = tp->pdev;
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 6d52cb2..867dae1 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3252,7 +3252,7 @@ struct tg3 {
const struct firmware *fw;
u32 fw_len; /* includes BSS */
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_DEPENDENCY_SATISFIED(CONFIG_TIGON3, CONFIG_HWMON)
struct device *hwmon_dev;
#endif
};
--
1.7.10.3
next prev parent reply other threads:[~2012-10-01 12:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 12:21 [PATCH 1/2] kconfig: Introduce IS_DEPENDENCY_SATISFIED() Anisse Astier
2012-10-01 12:21 ` Anisse Astier [this message]
2012-10-01 16:10 ` [PATCH 2/2] tg3: fix build-time dependency with IS_DEPENDENCY_SATISFIED() Paul Gortmaker
2012-10-01 21:45 ` David Miller
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=1349094080-769-2-git-send-email-anisse@astier.eu \
--to=anisse@astier.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=mcarlson@broadcom.com \
--cc=mchan@broadcom.com \
--cc=mmarek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).