All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
	linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527
Date: Mon, 28 Nov 2011 14:59:12 +0100	[thread overview]
Message-ID: <4ED393B0.2030004@grandegger.com> (raw)
In-Reply-To: <4ED379F3.1070206-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On 11/28/2011 01:09 PM, Marc Kleine-Budde wrote:
> On 11/25/2011 10:43 AM, Wolfgang Grandegger wrote:
>> This patch adds support for legacy Bosch CC770 and Intel AN82527 CAN
>> controllers on the ISA or PC-104 bus. The I/O port or memory address
>> and the IRQ number must be specified via module parameters:
>>
>>   insmod cc770_isa.ko port=0x310,0x380 irq=7,11
>>
>> for ISA devices using I/O ports or:
>>
>>   insmod cc770_isa.ko mem=0xd1000,0xd1000 irq=7,11
>>
>> for memory mapped ISA devices.
>>
>> Indirect access via address and data port is supported as well:
>>
>>   insmod cc770_isa.ko port=0x310,0x380 indirect=1 irq=7,11
>>
>> Furthermore, the following mode parameter can be defined:
>>
>>   clk: External oscillator clock frequency (default=16000000 [16 MHz])
>>   cir: CPU interface register (default=0x40 [DSC])
>>   ocr, Bus configuration register (default=0x40 [CBY])
>>   cor, Clockout register (default=0x00)
>>
>> Note: for clk, cir, bcr and cor, the first argument re-defines the
>> default for all other devices, e.g.:
>>
>>   insmod cc770_isa.ko mem=0xd1000,0xd1000 irq=7,11 clk=24000000
>>
>> is equivalent to
>>
>>   insmod cc770_isa.ko mem=0xd1000,0xd1000 irq=7,11 clk=24000000,24000000
>>
>> Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> 
> Some nitpicking inside.
> 
> Marc
>> ---
>>  drivers/net/can/cc770/Kconfig     |   11 ++
>>  drivers/net/can/cc770/Makefile    |    1 +
>>  drivers/net/can/cc770/cc770_isa.c |  336 +++++++++++++++++++++++++++++++++++++
>>  3 files changed, 348 insertions(+), 0 deletions(-)
>>  create mode 100644 drivers/net/can/cc770/cc770_isa.c
>>
>> diff --git a/drivers/net/can/cc770/Kconfig b/drivers/net/can/cc770/Kconfig
>> index 225131b..28e4d48 100644
>> --- a/drivers/net/can/cc770/Kconfig
>> +++ b/drivers/net/can/cc770/Kconfig
>> @@ -1,3 +1,14 @@
>>  menuconfig CAN_CC770
>>  	tristate "Bosch CC770 and Intel AN82527 devices"
>>  	depends on CAN_DEV && HAS_IOMEM
>> +
>> +if CAN_CC770
>> +
>> +config CAN_CC770_ISA
>> +	tristate "ISA Bus based legacy CC770 driver"
>> +	---help---
>> +	  This driver adds legacy support for CC770 and AN82527 chips
>> +	  connected to the ISA bus using I/O port, memory mapped or
>> +	  indirect access.
>> +
>> +endif
>> diff --git a/drivers/net/can/cc770/Makefile b/drivers/net/can/cc770/Makefile
>> index 34e8180..872ecff 100644
>> --- a/drivers/net/can/cc770/Makefile
>> +++ b/drivers/net/can/cc770/Makefile
>> @@ -3,5 +3,6 @@
>>  #
>>  
>>  obj-$(CONFIG_CAN_CC770) += cc770.o
>> +obj-$(CONFIG_CAN_CC770_ISA) += cc770_isa.o
>>  
>>  ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
>> diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
...
>> +	for (idx = 0; idx < MAXDEV; idx++) {
> ARRAY_SIZE?

Well, I think ARRAY_SIZE is useful to derive the number of elements from
a static array of the type:

  static const int array[] = { 1, 2, 3, 4, }

but not if its declared as:

  static array[MAXDEV]:

... or have I missed something?

I'm fine with all other comments.

Wolfgang.

  parent reply	other threads:[~2011-11-28 13:59 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25  9:43 [PATCH net-next v2 0/4] can: cc770: add support for the Bosch CC770 and Intel AN82527 Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 1/4] can: cc770: add driver core " Wolfgang Grandegger
     [not found]   ` <1322214204-1121-2-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-26 15:11     ` Oliver Hartkopp
2011-11-28 11:28   ` [Socketcan-users] " Marc Kleine-Budde
2011-11-28 13:52     ` Wolfgang Grandegger
     [not found]       ` <4ED3922A.50704-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-28 14:01         ` Marc Kleine-Budde
2011-11-28 14:01           ` [Socketcan-users] " David Laight
2011-11-28 14:01             ` David Laight
     [not found]           ` <4ED3941D.3070302-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 14:10             ` Wolfgang Grandegger
     [not found]               ` <4ED3966E.7080609-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-28 14:18                 ` Marc Kleine-Budde
     [not found]     ` <4ED3704D.5020903-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-29  9:20       ` Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527 Wolfgang Grandegger
     [not found]   ` <1322214204-1121-3-git-send-email-wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-11-26 14:59     ` Oliver Hartkopp
2011-11-28  8:56       ` Wolfgang Zarre
2011-11-28  9:17         ` Wolfgang Grandegger
2011-11-28 12:03           ` Wolfgang Zarre
     [not found]             ` <4ED37885.8080909-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-11-28 16:06               ` Oliver Hartkopp
     [not found]                 ` <4ED3B198.2040308-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2011-11-29  9:16                   ` Wolfgang Grandegger
     [not found]                     ` <4ED4A2EC.40103-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-04 18:47                       ` Wolfgang Zarre
2011-12-04 18:56                         ` Wolfgang Grandegger
     [not found]                           ` <4EDBC25D.50405-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-06 21:08                             ` Wolfgang Zarre
     [not found]                               ` <4EDE8435.5080100-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-07 13:42                                 ` Wolfgang Grandegger
2011-12-09 10:26                                   ` Wolfgang Grandegger
2011-12-11 18:33                                     ` Wolfgang Zarre
     [not found]                                       ` <4EE4F76E.3000506-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-12  9:23                                         ` Wolfgang Grandegger
2011-12-12  9:23                                           ` Wolfgang Grandegger
     [not found]                                           ` <4EE5C824.2050704-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-12 11:18                                             ` Wolfgang Zarre
2011-12-12 11:55                                               ` Wolfgang Grandegger
     [not found]                                                 ` <4EE5EBBF.6080007-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-21 18:32                                                   ` Wolfgang Zarre
2011-12-22  9:37                                                     ` Wolfgang Grandegger
     [not found]                                                       ` <4EF2FA3F.3010308-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-12-22 13:20                                                         ` Wolfgang Zarre
     [not found]                                                           ` <4EF32E84.1080006-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2011-12-31  9:39                                                             ` Wolfgang Zarre
2012-01-04 13:10                                                               ` Wolfgang Grandegger
2012-01-05  3:29                                                                 ` Wolfgang Zarre
     [not found]                                                                   ` <4F051927.8010600-PyqsHJVlJN8AvxtiuMwx3w@public.gmane.org>
2012-01-05 11:51                                                                     ` Wolfgang Grandegger
2012-01-05 12:00                                                                       ` David Laight
2012-01-05 12:00                                                                         ` David Laight
2012-01-09 21:47                                                                         ` Wolfgang Zarre
2012-01-09 23:11                                                                           ` Marc Kleine-Budde
2012-01-10  9:30                                                                             ` Wolfgang Grandegger
2012-01-10 12:30                                                                               ` Wolfgang Zarre
2012-01-10 14:20                                                                                 ` Wolfgang Grandegger
2012-01-10 14:25                                                                                   ` Wolfgang Grandegger
2012-01-11  9:00                                                                                 ` Wolfgang Zarre
2012-01-11  9:37                                                                                   ` David Laight
2012-01-11  9:37                                                                                     ` David Laight
2012-01-11 14:37                                                                                     ` Wolfgang Zarre
2012-01-11  9:38                                                                                   ` Marc Kleine-Budde
2012-01-11 14:42                                                                                     ` Wolfgang Zarre
2012-01-11 15:02                                                                                       ` Marc Kleine-Budde
2012-01-10 10:00                                                                           ` David Laight
2012-01-10 10:00                                                                             ` David Laight
2012-01-10 12:41                                                                             ` Wolfgang Zarre
2012-01-10 14:43                                                                               ` Wolfgang Grandegger
2012-01-10 14:50                                                                                 ` Oliver Hartkopp
2012-01-10 16:13                                                                                 ` Wolfgang Zarre
2012-01-10 16:20                                                                                   ` Marc Kleine-Budde
2012-01-10 16:23                                                                                   ` Wolfgang Grandegger
2012-01-10 19:02                                                                                     ` Wolfgang Zarre
2012-01-11  9:05                                                                                       ` Wolfgang Zarre
2012-01-11  9:31                                                                                         ` Marc Kleine-Budde
2012-01-10 11:41                                                                           ` Henrik Maier
2012-01-10 11:59                                                                             ` Wolfgang Grandegger
2012-01-10 12:43                                                                               ` Wolfgang Zarre
2012-01-05 19:45                                                                       ` Oliver Hartkopp
2012-01-05 20:48                                                                         ` Oliver Hartkopp
2011-12-23 11:32                                                       ` peak_pci: device channels chained list issue Grosjean Stephane
2011-12-23 12:11                                                       ` peak_pci: device channels chained list issue (cont.) Grosjean Stephane
2012-01-31 22:12                                                         ` Marc Kleine-Budde
2011-11-28 12:09   ` [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527 Marc Kleine-Budde
     [not found]     ` <4ED379F3.1070206-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 13:59       ` Wolfgang Grandegger [this message]
2011-11-28 14:03         ` David Laight
2011-11-28 14:03           ` David Laight
     [not found]           ` <AE90C24D6B3A694183C094C60CF0A2F6D8AEE9-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2011-11-28 14:09             ` Marc Kleine-Budde
     [not found]               ` <4ED3960F.4040508-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-28 15:10                 ` Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 3/4] can: cc770: add platform " Wolfgang Grandegger
2011-11-25  9:43   ` Wolfgang Grandegger
2011-11-25  9:43 ` [PATCH net-next v2 4/4] powerpc: tqm8548/tqm8xx: add and update CAN device nodes Wolfgang Grandegger
2011-11-25  9:43   ` 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=4ED393B0.2030004@grandegger.com \
    --to=wg-5yr1bzd7o62+xt7jha+gda@public.gmane.org \
    --cc=linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.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 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.