mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Jean Delvare <jdelvare@suse.de>
Cc: Laszlo Papp <lpapp@kde.org>,
	linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
	lm-sensors@lm-sensors.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (max6650) Rename the device ids to contain the hwmon suffix
Date: Mon, 10 Feb 2014 16:58:53 +0000	[thread overview]
Message-ID: <20140210165853.GD26997@lee--X1> (raw)
In-Reply-To: <20140210173811.04ba5964@endymion.delvare>

> > >  static const struct i2c_device_id max6650_id[] = {
> > > -	{ "max6650", 1 },
> > > -	{ "max6651", 4 },
> > > +	{ "max6650-hwmon", 1 },
> > > +	{ "max6651-hwmon", 4 },
> 
> No, this is not acceptable, sorry. This will change the name of the
> hwmon device as seen from user-space, breaking any configuration file
> referring to it. Additionally, dashes are explicitly forbidden in hwmon
> device names. And lastly this will break any explicit instantiation of
> theses devices (which is the only way, as the driver doesn't support
> device auto-detection), be it in the kernel itself or from user-space.
> 
> The change doesn't make sense anyway. If you move to the MFD framework,
> the core driver will be an I2C driver binding to the I2C device, and it
> will spawn the logical devices, presumably in the form of platform
> devices. That's what the current max6650 driver would have to bind to.
> Just renaming the device won't work, you also need to change the type.
> 
> If you want to turn this into an MFD driver, I believe you must first
> convert the hwmon part to register using
> devm_hwmon_device_register_with_groups(). This will dissociate the i2c
> device name from the hwmon device name and create a clean name-space
> for each function. Guenter, maybe you had a plan to do so already
> anyway?
> 
> That being said, going with MFD in this case seems quite overkill to
> me. MFD makes a lot of sense when each function has its own resources.
> As this isn't the case here, a single driver registering both an hwmon
> interface and a pinctrl interface would seem sufficient to me. But I
> think Guenter already discussed this in the past so I'll let him
> continue and decide.

I'll get you guys decide if you want to go the MFD route or not.

Either is okay with me, but if you do decide in favour, a name change
with the device type appended would be preferred. Else the core device
would have the same name as all of its children which would be quite
unworkable.

> > Might be worth taking the opportunity to swap out these magic numbers
> > now.
> 
> There's nothing magic about them, they tell the driver how many fans
> each device supports. If you don't pass them as driver_data you'll have
> to derive them from the device name in the probe function.

They're magic in that they're not easily identifiable. In the few
moments that I looked at the patch I assumed they were device
IDs. They should be clearly defined.

> > >  	{ }
> > >  };
> > >  MODULE_DEVICE_TABLE(i2c, max6650_id);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  parent reply	other threads:[~2014-02-10 16:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 15:25 Laszlo Papp
2014-02-10 16:08 ` Lee Jones
2014-02-10 16:38   ` [lm-sensors] " Jean Delvare
2014-02-10 16:53     ` linux
2014-02-10 18:59       ` Laszlo Papp
2014-02-10 23:10         ` Guenter Roeck
2014-02-11  3:23           ` Laszlo Papp
2014-02-11  3:35             ` Laszlo Papp
2014-02-10 16:58     ` Lee Jones [this message]
2014-02-10 17:43       ` Jean Delvare
2014-02-10 18:01         ` Lee Jones
2014-02-10 18:15           ` [lm-sensors] " Jean Delvare
2014-02-10 18:24             ` Lee Jones
2014-02-10 18:27         ` Laszlo Papp
2014-02-10 18:55           ` [lm-sensors] " Jean Delvare
2014-02-10 17:06     ` Laszlo Papp
2014-02-10 17:09       ` Laszlo Papp
2014-02-11  3:13     ` Laszlo Papp
2014-02-11  7:50       ` Jean Delvare
2014-02-11  8:19         ` Laszlo Papp
2014-02-11  8:28         ` Laszlo Papp
2014-02-11  8:49           ` Jean Delvare
2014-02-11  9:08             ` Laszlo Papp
2014-02-11  9:57               ` Lee Jones
2014-02-11 15:15                 ` Laszlo Papp
2014-02-11  8:50           ` Lee Jones
2014-02-11  8:58             ` Laszlo Papp
2014-02-11  9:14               ` Laszlo Papp
2014-02-11  9:47               ` Lee Jones
2014-02-11  9:50                 ` Laszlo Papp
2014-02-11 10:22             ` Laszlo Papp
2014-02-11 11:09               ` Laszlo Papp

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=20140210165853.GD26997@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lm-sensors@lm-sensors.org \
    --cc=lpapp@kde.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

all inboxes | Powered by JetHome®