All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>,
	linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH v4] peak_pci: add support for PEAK-System PCIe/PCIeC/miniPCI cards
Date: Wed, 01 Feb 2012 16:48:08 +0100	[thread overview]
Message-ID: <4F295EB8.3090202@pengutronix.de> (raw)
In-Reply-To: <4F295865.2040304@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1505 bytes --]

On 02/01/2012 04:21 PM, Marc Kleine-Budde wrote:

[...]

>> +/* PCIeC leds management needs I2C algobit */
>> +#if defined(CONFIG_I2C_ALGOBIT) || defined(CONFIG_I2C_ALGOBIT_MODULE)
>> +#define PEAK_CONFIG_PCIEC_LEDS
>> +#endif
> 
> ifdefs in the .c file are not welcome in general. What about something
> like this:
> 
> #if defined(CONFIG_I2C_ALGOBIT) || defined(CONFIG_I2C_ALGOBIT_MODULE)
> #define peak_pci_support_pcie()	(1)
> #else
> #define peak_pci_support_pcie()	(0)
> #endif
> 
> In the probe function you can write:
> 
> probe() {
> 	...
> 
> 	if (peak_pci_support_pcie() &&
> 	    pdev->device == PEAK_PCIEC_DEVICE_ID) {
> 		...
> 	}
> }
> 
> There should be no ifdefs left in the code. One question remains, is the
> i2c core clever enough to define no-ops if the i2c subsystem is switched
> off?

I just tried - :( - it doesn't work

drivers/net/can/sja1000/peak_pci.c: In function 'peak_pciec_write_pca9553':
drivers/net/can/sja1000/peak_pci.c:267: error: implicit declaration of function 'i2c_transfer'
drivers/net/can/sja1000/peak_pci.c: In function 'peak_pciec_init':
drivers/net/can/sja1000/peak_pci.c:491: error: implicit declaration of function 'i2c_del_adapter'

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2012-02-01 15:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 14:57 [PATCH v4] peak_pci: add support for PEAK-System PCIe/PCIeC/miniPCI cards Stephane Grosjean
2012-02-01 15:21 ` Marc Kleine-Budde
2012-02-01 15:34   ` Wolfgang Grandegger
2012-02-01 16:04     ` Stephane Grosjean
2012-02-01 16:19       ` Wolfgang Grandegger
2012-02-01 15:48   ` Marc Kleine-Budde [this message]
2012-02-01 15:55     ` Stephane Grosjean
2012-02-01 15:57       ` Marc Kleine-Budde
2012-02-01 16:12         ` Stephane Grosjean
2012-02-01 16:14         ` Wolfgang Grandegger
2012-02-01 16:37           ` Stephane Grosjean
2012-02-01 16:45             ` Wolfgang Grandegger

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=4F295EB8.3090202@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=s.grosjean@peak-system.com \
    --cc=wg@grandegger.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.