From: Aristeu Sergio Rozanski Filho <aris@ruivo.org>
To: Jenny TC <jenny.tc@intel.com>
Cc: khali@linux-fr.org, guenter.roeck@ericsson.com,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: Generic ADC support for hwmon
Date: Tue, 15 May 2012 09:29:19 -0400 [thread overview]
Message-ID: <20120515132919.GA11693@jake.ruivo.org> (raw)
In-Reply-To: <1337092008-31263-1-git-send-email-jenny.tc@intel.com>
Hi Jenny,
On Tue, May 15, 2012 at 07:56:48PM +0530, Jenny TC wrote:
> --- /dev/null
> +++ b/drivers/hwmon/hwmon-adc.c
> @@ -0,0 +1,212 @@
> +/*
> + * hwmon-adc.c - Generic adc support for hardware monitoring subsystem.
> + *
> + * Copyright (C) 2012 Intel Corp
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; version 2 of the License.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write to the Free Software Foundation, Inc.,
> + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + * Author : Jenny TC <jenny.tc@intel.com>
> + */
> +
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/device.h>
> +#include <linux/hwmon.h>
> +#include <linux/hwmon-adc.h>
> +
> +LIST_HEAD(adc_lst);
> +DEFINE_MUTEX(list_lock);
need static here?
> +struct device *hwmon_adc_device_register(struct device *dev,
> + struct hwmon_adc_ops *adc_ops)
> +{
> + struct hwmon_adc *adc_node;
> + struct device *hwdev;
> +
> + hwdev = hwmon_device_register(dev);
> + if (IS_ERR(hwdev))
> + return hwdev;
> +
> + adc_node = kzalloc(sizeof(struct hwmon_adc), GFP_ATOMIC);
why are you using GFP_ATOMIC here? and you need to handle the case when the
allocation fails
--
Aristeu
prev parent reply other threads:[~2012-05-16 15:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 14:26 Jenny TC
2012-05-15 12:13 ` Guenter Roeck
2012-05-15 12:42 ` [lm-sensors] " R, Durgadoss
2012-05-15 13:42 ` Guenter Roeck
2012-05-15 14:18 ` Lars-Peter Clausen
2012-05-15 14:31 ` Jonathan Cameron
2012-05-16 8:48 ` Tc, Jenny
2012-05-16 9:57 ` Jonathan Cameron
2012-05-15 13:29 ` Aristeu Sergio Rozanski Filho [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=20120515132919.GA11693@jake.ruivo.org \
--to=aris@ruivo.org \
--cc=guenter.roeck@ericsson.com \
--cc=jenny.tc@intel.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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®