linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Stefano Babic <sbabic@denx.de>, linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Wolfgang Grandegger <wg@grandegger.com>
Subject: Re: [PATCH v1 2/3] CAN: CAN driver to support multiple CAN bus on SPI interface
Date: Fri, 21 Mar 2014 22:42:16 +0100	[thread overview]
Message-ID: <532CB238.9000909@hartkopp.net> (raw)
In-Reply-To: <1395404758-21977-3-git-send-email-sbabic@denx.de>

Hello Stephano,

I definitely like this driver as it implements a full featured CAN netdev over
SPI with all the SocketCAN specific configuration stuff :-)

First some general comments:

There's a mixup of the driver name:

spican
spi_can
#define DRV_NAME		"imxhcscan"

>  drivers/net/can/Kconfig             |   11 +
>  drivers/net/can/Makefile            |    1 +
>  drivers/net/can/spi_can.c           | 1533 +++++++++++++++++++++++++++++++++++
>  include/linux/can/platform/spican.h |   36 +

I would first suggest to create a new directory

linux/drivers/net/can/spi

and move the mcp251x there (including the Kconfig stuff which is only entered
when SPI is enabled similar to the CAN USB adapter configs).

As the driver and it's communication concept is not very specific for the
hcs12 or imx35 (or should no be very specific) I would tend to name it

	spi_can

and rename the 'hcs12' or 'imx' named functions to something more generic,
e.g. spi_slave, spi_can or something better.

Maybe when there is really imx35 or hcs12 specific stuff to handle, this
should be made clear, e.g. with a imx_spi_can driver which uses the spi_can
driver?!?

And then there has to be a Kconfig option which depends on IMX35/ARM.


> +#ifndef __CAN_PLATFORM_SPICAN_H__
> +#define __CAN_PLATFORM_SPICAN_H__
> +
> +#include <linux/spi/spi.h>
> +
> +/*
> + * struct hcs12_imx_platform_data - i.MX to HCS12 CAN controller platform data
> + */
> +
> +struct hcs12_imx_platform_data {
> +	unsigned int can_channels;
> +	unsigned int gpio;
> +	unsigned int active;
> +	unsigned int slow_freq;
> +};
> +
> +#endif
> 

Is this really i.MX or HCS12 specific??

Regards,
Oliver

  reply	other threads:[~2014-03-21 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 12:25 [PATCH v1 0/3] Adding support for CAN busses via SPI interface Stefano Babic
2014-03-21 12:25 ` [PATCH v1 1/3] Add documentation for SPI to CAN driver Stefano Babic
2014-11-24 10:50   ` Nicola
2014-03-21 12:25 ` [PATCH v1 2/3] CAN: CAN driver to support multiple CAN bus on SPI interface Stefano Babic
2014-03-21 21:42   ` Oliver Hartkopp [this message]
2014-03-23 12:01     ` Stefano Babic
2014-03-21 12:25 ` [PATCH v1 3/3] Introduce can_get_echo_skb_ni() when TX is not in interrupt Stefano Babic

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=532CB238.9000909@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=sbabic@denx.de \
    --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 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).