lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4CE347531D4CA947960AF71FF095B9323E94FA21@DBDE01.ent.ti.com>
Date:	Tue, 28 Aug 2012 10:23:34 +0000
From:	"Patil, Rachna" <rachna@...com>
To:	Matthias Kaehlcke <matthias.list@...hlcke.net>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Dmitry Torokhov <dtor@...l.ru>,
	Jonathan Cameron <jic23@....ac.uk>,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: RE: [PATCH 4/5] IIO : ADC: tiadc: Add support of TI's ADC driver

Hi,

On Fri, Aug 24, 2012 at 00:32:39, Matthias Kaehlcke wrote:
> Hi,
> 
> El Thu, Aug 23, 2012 at 04:20:21PM +0530 Patil, Rachna ha dit:
> 
> > This patch adds support for TI's ADC driver.
> > This is a multifunctional device.
> > Analog input lines are provided on which voltage measurements can be 
> > carried out.
> > You can have upto 8 input lines.
> > 
> > Signed-off-by: Patil, Rachna <rachna@...com>
> > ---
> >
> > diff --git a/drivers/iio/adc/ti_adc.c b/drivers/iio/adc/ti_adc.c ...
> > +static int __devinit tiadc_probe(struct platform_device *pdev) {
> > +	struct iio_dev		*idev;
> > +	int			err;
> > +	struct adc_device	*adc_dev = NULL;
> > +	struct ti_tscadc_dev	*tscadc_dev = pdev->dev.platform_data;
> > +	struct mfd_tscadc_board	*board_data;
> > +
> > +	board_data = (struct mfd_tscadc_board *)tscadc_dev->dev->platform_data;
> > +	if (!board_data) {
> > +		dev_err(tscadc_dev->dev, "Could not find platform data\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	idev = iio_device_alloc(sizeof(struct adc_device));
> > +	if (idev == NULL) {
> > +		dev_err(&pdev->dev, "failed to allocate iio device.\n");
> > +		err = -ENOMEM;
> > +		goto err_ret;
> > +	}
> > +	adc_dev = iio_priv(idev);
> > +
> > +	tscadc_dev->adc = adc_dev;
> > +	adc_dev->mfd_tscadc = tscadc_dev;
> > +	adc_dev->idev = idev;
> > +	adc_dev->adc_channels = board_data->adc_init->adc_channels;
> > +
> > +	idev->dev.parent = &pdev->dev;
> > +	idev->name = dev_name(&pdev->dev);
> > +	idev->modes = INDIO_DIRECT_MODE;
> > +	idev->info = &tiadc_info;
> > +
> > +	adc_step_config(adc_dev);
> > +
> > +	err = tiadc_channel_init(idev, adc_dev);
> > +	if (err < 0)
> > +		goto err_fail;
> > +
> > +	err = iio_device_register(idev);
> > +	if (err)
> > +		goto err_free_channels;
> > +
> > +	dev_info(&pdev->dev, "attached adc driver\n");
> > +	platform_set_drvdata(pdev, idev);
> > +
> > +	return 0;
> > +
> > +err_free_channels:
> > +	tiadc_channel_remove(idev);
> > +err_fail:
> > +	iio_device_unregister(idev);
> > +	iio_device_free(idev);
> > +err_ret:
> > +	platform_set_drvdata(pdev, NULL);
> 
> not necessary, the platform device doesn't exist anymore

Ok. I will correct this.

> 
> > +	iio_device_free(idev);
> 
> already done some lines above and could be executed without having allocated the iio device (when iio_device_alloc() fails)
> 
> > +static int __devexit tiadc_remove(struct platform_device *pdev) {
> > +	struct ti_tscadc_dev   *tscadc_dev = pdev->dev.platform_data;
> > +	struct adc_device	*adc_dev = tscadc_dev->adc;
> > +	struct iio_dev		*idev = adc_dev->idev;
> > +
> > +	iio_device_unregister(idev);
> > +	tiadc_channel_remove(idev);
> > +
> > +	tscadc_dev->adc = NULL;
> > +
> > +	iio_device_free(idev);
> > +	platform_set_drvdata(pdev, NULL);
> 
> see above

Yes, will correct this as well.

> 
> best regards
> 
> --
> Matthias Kaehlcke
> Embedded Linux Developer
> Amsterdam
> 
>                If sharing a thing in no way diminishes it,
>                it is not rightly owned if it is not shared
>                                                                  .''`.
>     using free software / Debian GNU/Linux | http://debian.org  : :'  :
>                                                                 `. `'`
> gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
> 

Regards,
Rachna

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ