public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Ian Abbott <ian.abbott@mev.co.uk>,
	Greg KH <gregkh@linuxfoundation.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"fmhess@users.sourceforge.net" <fmhess@users.sourceforge.net>
Subject: Re: [PATCH] staging: comedi: Convert struct addi_board initialization to C99 format
Date: Fri, 18 May 2012 11:05:02 +0100	[thread overview]
Message-ID: <4FB61ECE.6060202@mev.co.uk> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F0020698AE1119@AUSP01VMBX24.collaborationhost.net>

On 2012-05-17 22:12, H Hartley Sweeten wrote:
> On Thursday, May 17, 2012 11:29 AM, Ian Abbott wrote:
>> On 17/05/2012 17:38, H Hartley Sweeten wrote:
>>> BTW, what actual hardware do you have available to test with?
>>
>> Not a lot.  Just the Amplicon cards (amplc_* drivers).
>
> Speaking of the amplc_* drivers... What's up with them?
>
> The dio200, pc236, and pc263 drivers appear to be some kind of
> hybrid comedi driver/comedi pci driver.

That's right.  The ISA devices and PCI devices are selected separately 
in the configuration, but they are similar enough to share the same code.

> If the driver is simply
> registered as a comedi pci driver will the isa drivers still work?

Yes if both the ISA devices and PCI devices are enabled in the 
configuration.  But you might have one or the other.

In amplc_dio200.c (for example, but similarly for the others), you can 
assume that at least one of the CONFIG_COMEDI_AMPLC_DIO200_ISA and 
CONFIG_COMEDI_AMPLC_DIO200_PCI macros is #define'd, so you could do 
(with the existing variable names, that you'd probably change):

#ifdef CONFIG_COMEDI_AMPLC_DIO200_PCI
module_comedi_pci_driver(driver_amplc_dio200, 
driver_amplc_dio200_pci_driver);
#else
module_comedi_driver(driver_amplc_dio200);
#endif

(I guess you'd change driver_amplc_dio200 to amplc_dio200_driver and 
driver_amplc_dio200_pci_driver to amplc_dio200_pci_driver.)

> If so we can get rid of a bunch of #ifdef stuff.

Some of them are there to separately configure the ISA and PCI devices 
and some are just there to trim out some code that is unreachable when 
one or the other isn't defined.

I tend not to include several functions within the same #ifdef, so it 
should be easy to move things around to avoid forward declarations.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

      reply	other threads:[~2012-05-18 10:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17  0:51 [PATCH] staging: comedi: Convert struct addi_board initialization to C99 format H Hartley Sweeten
2012-05-17  2:18 ` Greg KH
2012-05-17  6:15   ` H Hartley Sweeten
2012-05-17  6:45     ` Ian Abbott
2012-05-17 13:32       ` Greg KH
2012-05-17 15:57         ` Ian Abbott
2012-05-17 16:38           ` H Hartley Sweeten
2012-05-17 18:28             ` Ian Abbott
2012-05-17 21:12               ` H Hartley Sweeten
2012-05-18 10:05                 ` Ian Abbott [this message]

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=4FB61ECE.6060202@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --cc=ian.abbott@mev.co.uk \
    --cc=linux-kernel@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