devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: jdelvare@suse.com, robh+dt@kernel.org, mark.rutland@arm.com,
	linux-hwmon@vger.kernel.org, corbet@lwn.net,
	devicetree@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH 2/3] hwmon: Add convience macro to define simple static sensors
Date: Wed, 20 Mar 2019 10:38:49 -0700	[thread overview]
Message-ID: <20190320173849.GA17363@roeck-us.net> (raw)
In-Reply-To: <20190320145818.30644-2-ckeepax@opensource.cirrus.com>

On Wed, Mar 20, 2019 at 02:58:17PM +0000, Charles Keepax wrote:
> It takes a fair amount of boiler plate code to add new sensors, add a
> macro that can be used to specify simple static sensors.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Great idea!

Applied to hwmon-next; no need to resend.

Thanks,
Guenter

> ---
>  include/linux/hwmon.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
> index 99e0c1b0b5fb3..7a8cc06a0d61d 100644
> --- a/include/linux/hwmon.h
> +++ b/include/linux/hwmon.h
> @@ -365,6 +365,14 @@ struct hwmon_channel_info {
>  	const u32 *config;
>  };
>  
> +#define HWMON_CHANNEL_INFO(stype, ...)	\
> +	(&(struct hwmon_channel_info) {	\
> +		.type = hwmon_##stype,	\
> +		.config = (u32 []) {	\
> +			__VA_ARGS__, 0	\
> +		}			\
> +	})
> +
>  /**
>   * Chip configuration
>   * @ops:	Pointer to hwmon operations.
> -- 
> 2.11.0
> 

  reply	other threads:[~2019-03-20 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 14:58 [PATCH 1/3] hwmon: lochnagar: Add device tree binding document Charles Keepax
2019-03-20 14:58 ` [PATCH 2/3] hwmon: Add convience macro to define simple static sensors Charles Keepax
2019-03-20 17:38   ` Guenter Roeck [this message]
2019-03-20 14:58 ` [PATCH 3/3] hwmon: lochnagar: Add Lochnagar 2 hardware monitoring driver Charles Keepax
2019-03-20 16:40   ` Guenter Roeck
2019-03-21 11:59     ` Charles Keepax
2019-03-21 13:14       ` Guenter Roeck
2019-03-21 15:47         ` Charles Keepax
2019-03-21 16:03           ` Guenter Roeck

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=20190320173849.GA17363@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@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 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).