All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Alessandro Rubini <rubini@gnudd.com>
Cc: alan@lxorguk.ukuu.org.uk, federico.vaga@gmail.com,
	mkl@pengutronix.de, giancarlo.asnaghi@st.com,
	alan@linux.intel.com, linux-can@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] c_can_pci: generic module for c_can on PCI
Date: Mon, 11 Jun 2012 15:51:45 +0200	[thread overview]
Message-ID: <4FD5F7F1.3010602@grandegger.com> (raw)
In-Reply-To: <20120604164531.GA22000@mail.gnudd.com>

On 06/04/2012 06:45 PM, Alessandro Rubini wrote:
>> Anythign wrong with 
>>
>> bool aligned32;
> 
> I personally think booleans are evil.  But both this and the other
> thing:
> 
>>> +static u16 c_can_pci_read_reg_aligned_to_16bit(struct c_can_priv *priv,
>>> +						void *reg)
>>
>> I'm a bit worried this function name might be too short ;)
> 
> come from the platform driver this is based on (I already blamed
> federico offlist for not preserving authorship of the original file).
> 
> So, this file is mostly copied from the platform driver, which is a
> duplication of code.  A mandated duplication, given how the thing
> is currently laid out: the c_can core driver exports functions that
> the other two files are using (the platform and the new pci driver).
> 
> In my opinion, it would be much better to have one less layer and no
> exports at all. The core driver should be a platform driver, and the
> pci driver would just build platform data and register the platform
> device.

Do you have examples for that approach? Not sure yet if it really saves
code and makes it more readable.

> Sure this isn't up to federico, who has the pci device but cannot
> access any boards where the previous driver is used.  What do the
> maintainers think? I (or federico :) may propose a reshaping, if
> the idea makes sense.

I would suggest to provide the c_can_pci driver using the *current* API,
even if it's not optimal. Federicos patch then already looks quite good.
It should use the new register access methods introduced by the D_CAN
support patch, though.

Any further improvements to the device abstraction and a more consistent
handling of the platform data are welcome.

Wolfgang.

  reply	other threads:[~2012-06-11 13:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 20:59 [PATCH] STA2X11 CAN: CAN driver for the STA2X11 board Federico Vaga
2012-05-18  6:00 ` Wolfgang Grandegger
2012-05-26  8:36   ` Federico Vaga
2012-05-26 19:57     ` Wolfgang Grandegger
2012-06-04 13:32       ` generic module for c-can on pci Federico Vaga
2012-06-04 13:32         ` [PATCH RFC] c_can_pci: generic module for c_can on PCI Federico Vaga
2012-06-04 14:04           ` Marc Kleine-Budde
2012-06-12 14:25             ` Federico Vaga
2012-06-12 14:46               ` Marc Kleine-Budde
2012-06-12 14:53                 ` Federico Vaga
2012-06-04 15:56           ` Alan Cox
2012-06-04 16:45             ` Alessandro Rubini
2012-06-11 13:51               ` Wolfgang Grandegger [this message]
2012-06-11 14:23                 ` Alessandro Rubini
2012-06-04 16:45             ` Federico Vaga
2012-06-05  3:42               ` Bhupesh SHARMA
2012-06-05 11:19                 ` Federico Vaga
2012-06-05 13:04                   ` Bhupesh SHARMA
2012-06-05 13:13                     ` Alessandro Rubini
2012-06-05 13:21                       ` Marc Kleine-Budde
2012-06-05 13:30                         ` Alessandro Rubini
2012-06-05 15:12                           ` AnilKumar, Chimata
2012-06-05 16:50                             ` Alessandro Rubini
2012-06-06  3:50                               ` Bhupesh SHARMA
2012-06-11 13:18                                 ` Federico Vaga
2012-06-11 14:21                                   ` Wolfgang Grandegger
2012-06-05 13:22                       ` Bhupesh SHARMA
2012-06-11 14:09           ` 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=4FD5F7F1.3010602@grandegger.com \
    --to=wg@grandegger.com \
    --cc=alan@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=federico.vaga@gmail.com \
    --cc=giancarlo.asnaghi@st.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=rubini@gnudd.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.