All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Ben Dooks <ben-linux@fluff.org>
Subject: Re: [-mmotm] some different buliding failures
Date: Wed, 2 Jul 2008 01:14:52 -0700	[thread overview]
Message-ID: <20080702011452.37bcec2f.akpm@linux-foundation.org> (raw)
In-Reply-To: <486B1EE0.9060303@cn.fujitsu.com>

On Wed, 02 Jul 2008 14:23:28 +0800 Li Zefan <lizf@cn.fujitsu.com> wrote:

> drivers/mfd/sm501.c:39: error: field 'gpio' has incomplete type

OK, this monstrosity seems to make it compile:


diff -puN drivers/mfd/sm501.c~sm501-guess-n-giggle-build-fix drivers/mfd/sm501.c
--- a/drivers/mfd/sm501.c~sm501-guess-n-giggle-build-fix
+++ a/drivers/mfd/sm501.c
@@ -19,7 +19,9 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/pci.h>
+#ifdef CONFIG_MFD_SM501_GPIO
 #include <linux/gpio.h>
+#endif
 #include <linux/i2c-gpio.h>
 
 #include <linux/sm501.h>
@@ -33,6 +35,7 @@ struct sm501_device {
 	struct platform_device		pdev;
 };
 
+#ifdef CONFIG_MFD_SM501_GPIO
 struct sm501_gpio;
 
 struct sm501_gpio_chip {
@@ -50,13 +53,15 @@ struct sm501_gpio {
 	void __iomem		*regs;
 	struct resource		*regs_res;
 };
+#endif
 
 struct sm501_devdata {
 	spinlock_t			 reg_lock;
 	struct mutex			 clock_lock;
 	struct list_head		 devices;
+#ifdef CONFIG_MFD_SM501_GPIO
 	struct sm501_gpio		 gpio;
-
+#endif
 	struct device			*dev;
 	struct resource			*io_res;
 	struct resource			*mem_res;
@@ -1116,6 +1121,7 @@ static inline int sm501_gpio_pin2nr(stru
 }
 #endif
 
+#ifdef CONFIG_MFD_SM501_GPIO
 static int sm501_register_gpio_i2c_instance(struct sm501_devdata *sm,
 					    struct sm501_platdata_gpio_i2c *iic)
 {
@@ -1168,6 +1174,7 @@ static int sm501_register_gpio_i2c(struc
 
 	return 0;
 }
+#endif
 
 /* sm501_dbg_regs
  *
@@ -1329,12 +1336,14 @@ static int sm501_init_dev(struct sm501_d
 			sm501_register_gpio(sm);
 	}
 
+#ifdef CONFIG_MFD_SM501_GPIO
 	if (pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) {
 		if (!sm->gpio.registered)
 			dev_err(sm->dev, "no gpio registered for i2c gpio.\n");
 		else
 			sm501_register_gpio_i2c(sm, pdata);
 	}
+#endif
 
 	ret = sm501_check_clocks(sm);
 	if (ret) {
@@ -1643,8 +1652,10 @@ static void sm501_dev_remove(struct sm50
 
 	device_remove_file(sm->dev, &dev_attr_dbg_regs);
 
+#ifdef CONFIG_MFD_SM501_GPIO
 	if (sm->gpio.registered)
 		sm501_gpio_remove(sm);
+#endif
 }
 
 static void sm501_pci_remove(struct pci_dev *dev)
_


  parent reply	other threads:[~2008-07-02  8:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02  6:23 [-mmotm] some different buliding failures Li Zefan
2008-07-02  8:02 ` Andrew Morton
2008-07-02  8:20   ` Paul Mundt
2008-07-02  8:29     ` Ben Dooks
2008-07-02  8:14 ` Andrew Morton [this message]
2008-07-02  8:18   ` Li Zefan
2008-07-02 11:01 ` Andrew Morton
2008-07-02 11:48   ` Avi Kivity
2008-07-02 12:23     ` Hugh Dickins
2008-07-02 14:00       ` Avi Kivity

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=20080702011452.37bcec2f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ben-linux@fluff.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.