All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Re: [PATCH 2.6.12-rc5-mm1 2/3] i2c: new sysfs class
Date: Thu, 02 Jun 2005 08:00:50 +0000	[thread overview]
Message-ID: <20050602061045.GB8530@kroah.com> (raw)
In-Reply-To: <20050602033654.GC4906@jupiter.solarsys.private>

On Wed, Jun 01, 2005 at 11:36:54PM -0400, Mark M. Hoffman wrote:
> 
> This patch adds the sysfs class "hwmon" for use by hardware monitoring
> (sensors) chip drivers.  It (the Kconfig text) presumes that sensors
> chip drivers will be moved to drivers/hwmon (although that is not done
> by this patch).
> 
> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
> 
> Index: linux-2.6.12-rc5-mm1/drivers/Kconfig
> =================================> --- linux-2.6.12-rc5-mm1.orig/drivers/Kconfig
> +++ linux-2.6.12-rc5-mm1/drivers/Kconfig
> @@ -42,6 +42,8 @@ source "drivers/input/Kconfig"
>  
>  source "drivers/char/Kconfig"
>  
> +source "drivers/hwmon/Kconfig"
> +
>  source "drivers/i2c/Kconfig"
>  
>  source "drivers/w1/Kconfig"
> Index: linux-2.6.12-rc5-mm1/drivers/Makefile
> =================================> --- linux-2.6.12-rc5-mm1.orig/drivers/Makefile
> +++ linux-2.6.12-rc5-mm1/drivers/Makefile
> @@ -53,6 +53,7 @@ obj-$(CONFIG_GAMEPORT)		+= input/gamepor
>  obj-$(CONFIG_INPUT)		+= input/
>  obj-$(CONFIG_I2O)		+= message/
>  obj-$(CONFIG_I2C)		+= i2c/
> +obj-$(CONFIG_HWMON)		+= hwmon/
>  obj-$(CONFIG_W1)		+= w1/
>  obj-$(CONFIG_PHONE)		+= telephony/
>  obj-$(CONFIG_MD)		+= md/
> Index: linux-2.6.12-rc5-mm1/drivers/hwmon/Kconfig
> =================================> --- linux-2.6.12-rc5-mm1.orig/drivers/hwmon/Kconfig
> +++ linux-2.6.12-rc5-mm1/drivers/hwmon/Kconfig
> @@ -0,0 +1,15 @@
> +
> +menu "Hardware Monitoring (Sensors) support"
> +
> +config HWMON
> +	tristate "Hardware Monitoring Core support"
> +	help
> +	  If you want hardware monitoring (sensors) support, you should
> +	  say Y here and also to the specific driver(s) for your sensors
> +	  chip(s) below.
> +
> +	  This support can also be built as a module.  If so, the module
> +	  will be called hwmon.

Nice, but you forgot to enable this config option for all of the i2c
chip drivers that use it.  Without that, you get a bunch of compiler
errors at link time :)

Care to send a patch to fix this?

> +struct class_device *hwmon_device_register(struct device *dev, char *fmt, ...)

Do you really want free-form stuff here?  more on that in the next
patch...

> +#ifndef _HWMON_H_
> +#define _HWMON_H_
> +
> +#include <linux/device.h>
> +
> +struct class_device *hwmon_device_register(struct device *dev, char *fmt, ...);
> +
> +void hwmon_device_unregister(struct class_device *cdev);

You might want to just change this to the following, if you don't want
to change the Kconfig entries for the i2c chips:

#ifdef CONFIG_HWMON
struct class_device *hwmon_device_register(struct device *dev, char *fmt, ...);
void hwmon_device_unregister(struct class_device *cdev);
#else
static inline struct class_device *hwmon_device_register(struct device *dev, char *fmt, ...)
{
	return ERR_PTR(-ENODEV);
}
void hwmon_device_unregister(struct class_device *cdev) { }
#endif

But it's up to you...

thanks,

greg k-h

  reply	other threads:[~2005-06-02  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02  5:37 [lm-sensors] Re: [PATCH 2.6.12-rc5-mm1 2/3] i2c: new sysfs class Mark M. Hoffman
2005-06-02  8:00 ` Greg KH [this message]
2005-06-03  5:45 ` Mark M. Hoffman

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=20050602061045.GB8530@kroah.com \
    --to=greg@kroah.com \
    --cc=lm-sensors@vger.kernel.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.