mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>,
	"randy.dunlap@oracle.com" <randy.dunlap@oracle.com>,
	"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
	"sameo@linux.intel.com" <sameo@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	"dchen@diasemi.com" <dchen@diasemi.com>
Subject: RE: [lm-sensors] [PATCH 02/03] HWMON: HWMON driver for DA9052/53 PMIC v3
Date: Fri, 2 Mar 2012 08:50:53 -0800	[thread overview]
Message-ID: <1330707053.23014.279.camel@groeck-laptop> (raw)
In-Reply-To: <4D68720C2E767A4AA6A8796D42C8EB59046AE9@BGSMSX101.gar.corp.intel.com>

Hi Durga,

On Fri, 2012-03-02 at 11:44 -0500, R, Durgadoss wrote:
> Hi,
> 
> > -----Original Message-----
> > From: lm-sensors-bounces@lm-sensors.org [mailto:lm-sensors-bounces@lm-
> > sensors.org] On Behalf Of Ashish Jangam
> > Sent: Friday, March 02, 2012 7:59 PM
> > To: Guenter Roeck
> > Cc: randy.dunlap@oracle.com; linaro-dev@lists.linaro.org;
> > sameo@linux.intel.com; linux-kernel@vger.kernel.org; lm-sensors@lm-sensors.org;
> > dchen@diasemi.com
> > Subject: [lm-sensors] [PATCH 02/03] HWMON: HWMON driver for DA9052/53 PMIC v3
> >
> > The DA9052 PMIC provides an Analogue to Digital Converter with 10 bits
> > resolution and 10 channels.
> >
> > This patch monitors the DA9052 PMIC's ADC channels mostly for battery
> > parameters like battery temperature, junction temperature, battery
> > current etc.
> >
> > This patch is functionally tested on Samsung SMDKV6410
> >
> > Signed-off-by: David Dajun Chen <dchen@diasemi.com>
> > Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>

[ ... ]

> > +static int __init da9052_hwmon_probe(struct platform_device *pdev)
> > +{
> > +     struct da9052_hwmon *hwmon;
> > +     int ret;
> > +
> > +     hwmon = devm_kzalloc(&pdev->dev, sizeof(struct da9052_hwmon),
> > +                          GFP_KERNEL);
> > +     if (!hwmon)
> > +             return -ENOMEM;
> > +
> > +     mutex_init(&hwmon->hwmon_lock);
> > +     hwmon->da9052 = dev_get_drvdata(pdev->dev.parent);
> > +
> > +     platform_set_drvdata(pdev, hwmon);
> > +
> > +     ret = sysfs_create_group(&pdev->dev.kobj, &da9052_attr_group);
> > +     if (ret)
> > +             goto err_mem;
> > +
> > +     hwmon->class_device = hwmon_device_register(&pdev->dev);
> > +     if (IS_ERR(hwmon->class_device)) {
> > +             ret = PTR_ERR(hwmon->class_device);
> > +             goto err_sysfs;
> > +     }
> > +
> > +     return 0;
> > +
> > +err_sysfs:
> > +     sysfs_remove_group(&pdev->dev.kobj, &da9052_attr_group);
> > +err_mem:
> 
> I think you should do a kfree(hwmon) here.
> 

Not needed because devm_kzalloc() is used above.

> > +     return ret;
> > +}
> > +
> > +static int __devexit da9052_hwmon_remove(struct platform_device *pdev)
> > +{
> > +     struct da9052_hwmon *hwmon = platform_get_drvdata(pdev);
> > +
> > +     hwmon_device_unregister(hwmon->class_device);
> > +     sysfs_remove_group(&pdev->dev.kobj, &da9052_attr_group);
> 
>  Kfree(hwmon);
> 
Same here.

Guenter



  reply	other threads:[~2012-03-02 16:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 14:29 Ashish Jangam
2012-03-02 16:44 ` [lm-sensors] " R, Durgadoss
2012-03-02 16:50   ` Guenter Roeck [this message]
2012-03-02 16:54     ` R, Durgadoss
2012-03-07 19:08 ` Guenter Roeck
2012-03-08  2:21   ` Ashish Jangam

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=1330707053.23014.279.camel@groeck-laptop \
    --to=guenter.roeck@ericsson.com \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dchen@diasemi.com \
    --cc=durgadoss.r@intel.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=randy.dunlap@oracle.com \
    --cc=sameo@linux.intel.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

all inboxes | Powered by JetHome®