public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Samuel Iglesias Gonsálvez" <siglesias@igalia.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Manohar Vanga <manohar.vanga@cern.ch>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH v4 1/3] Staging: IndustryPack bus for the Linux Kernel
Date: Thu, 10 May 2012 09:42:24 -0700	[thread overview]
Message-ID: <20120510164224.GA13964@kroah.com> (raw)
In-Reply-To: <3c71a30f539ee297f781beede0a411f3@igalia.com>

On Thu, May 10, 2012 at 05:34:54PM +0100, Samuel Iglesias Gonsálvez wrote:
> >>> > +struct ipack_device {
> >>> > +   char board_name[IPACK_BOARD_NAME_SIZE];
> >>>
> >>> Why not use dev->name?
> >>
> >>May I be wrong, do you refer rename it to "name"?
> >
> >rename what?  Why do you need a board name for a device?
> >Shouldn't that
> >just be the "name" for the device?  And as such, just use the
> >field you
> >already have.
> >
> 
> In struct device there is the field "init_name". There is a "name"
> field in the corresponding struct kobject inside of dev. This is the
> reason of my misunderstanding.
> 
> I will change it.

Use the function call to set the name, not the field directly, otherwise
bad things could happen.

> >>> > +   char bus_name[IPACK_BOARD_NAME_SIZE];
> >
> >And, why do you need a bus name?  Shouldn't that be implied based on
> >what bus the device is attached to?
> >
> 
> This is the name of the bus device. The problem here is that the
> ipoctal mezzanine needs to save the IRQ vector in his memory space
> in a different address depending of the carrier board it is plugged
> to.
> 
> It is described in IP-OCTAL's datasheet. So this bus_name variable
> gives the way to do it.

But why is this a string?  I don't understand why this needs to be in
the device, shouldn't it just be determined on which bus the device was
assigned to?  Shouldn't this be part of the register function?  Pass in
the bus it should be registered to and all should be good.

greg k-h

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 13:27 [PATCH v4 1/3] Staging: IndustryPack bus for the Linux Kernel Samuel Iglesias Gonsalvez
2012-05-09 13:27 ` [PATCH v4 2/3] Staging: ipack: added support for the TEWS TPCI-200 carrier board Samuel Iglesias Gonsalvez
2012-05-09 21:15   ` Greg Kroah-Hartman
2012-05-09 13:27 ` [PATCH v4 3/3] Staging: ipack: add support for IP-OCTAL mezzanine board Samuel Iglesias Gonsalvez
2012-05-09 21:13 ` [PATCH v4 1/3] Staging: IndustryPack bus for the Linux Kernel Greg Kroah-Hartman
2012-05-10 14:23   ` Samuel Iglesias Gonsálvez
2012-05-10 15:37     ` Greg Kroah-Hartman
2012-05-10 16:34       ` Samuel Iglesias Gonsálvez
2012-05-10 16:42         ` Greg Kroah-Hartman [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=20120510164224.GA13964@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@cern.ch \
    --cc=siglesias@igalia.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