aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ad525x_dpot.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/ad525x_dpot.c')
-rw-r--r--drivers/misc/ad525x_dpot.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 7cb911028d09..1d1d42615915 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -64,7 +64,7 @@
64 * Author: Chris Verges <chrisv@cyberswitching.com> 64 * Author: Chris Verges <chrisv@cyberswitching.com>
65 * 65 *
66 * derived from ad5252.c 66 * derived from ad5252.c
67 * Copyright (c) 2006 Michael Hennerich <hennerich@blackfin.uclinux.org> 67 * Copyright (c) 2006-2011 Michael Hennerich <hennerich@blackfin.uclinux.org>
68 * 68 *
69 * Licensed under the GPL-2 or later. 69 * Licensed under the GPL-2 or later.
70 */ 70 */
@@ -76,8 +76,6 @@
76#include <linux/delay.h> 76#include <linux/delay.h>
77#include <linux/slab.h> 77#include <linux/slab.h>
78 78
79#define DRIVER_VERSION "0.2"
80
81#include "ad525x_dpot.h" 79#include "ad525x_dpot.h"
82 80
83/* 81/*
@@ -687,8 +685,9 @@ inline void ad_dpot_remove_files(struct device *dev,
687 } 685 }
688} 686}
689 687
690__devinit int ad_dpot_probe(struct device *dev, 688int __devinit ad_dpot_probe(struct device *dev,
691 struct ad_dpot_bus_data *bdata, const struct ad_dpot_id *id) 689 struct ad_dpot_bus_data *bdata, unsigned long devid,
690 const char *name)
692{ 691{
693 692
694 struct dpot_data *data; 693 struct dpot_data *data;
@@ -704,13 +703,13 @@ __devinit int ad_dpot_probe(struct device *dev,
704 mutex_init(&data->update_lock); 703 mutex_init(&data->update_lock);
705 704
706 data->bdata = *bdata; 705 data->bdata = *bdata;
707 data->devid = id->devid; 706 data->devid = devid;
708 707
709 data->max_pos = 1 << DPOT_MAX_POS(data->devid); 708 data->max_pos = 1 << DPOT_MAX_POS(devid);
710 data->rdac_mask = data->max_pos - 1; 709 data->rdac_mask = data->max_pos - 1;
711 data->feat = DPOT_FEAT(data->devid); 710 data->feat = DPOT_FEAT(devid);
712 data->uid = DPOT_UID(data->devid); 711 data->uid = DPOT_UID(devid);
713 data->wipers = DPOT_WIPERS(data->devid); 712 data->wipers = DPOT_WIPERS(devid);
714 713
715 for (i = DPOT_RDAC0; i < MAX_RDACS; i++) 714 for (i = DPOT_RDAC0; i < MAX_RDACS; i++)
716 if (data->wipers & (1 << i)) { 715 if (data->wipers & (1 << i)) {
@@ -731,7 +730,7 @@ __devinit int ad_dpot_probe(struct device *dev,
731 } 730 }
732 731
733 dev_info(dev, "%s %d-Position Digital Potentiometer registered\n", 732 dev_info(dev, "%s %d-Position Digital Potentiometer registered\n",
734 id->name, data->max_pos); 733 name, data->max_pos);
735 734
736 return 0; 735 return 0;
737 736
@@ -745,7 +744,7 @@ exit_free:
745 dev_set_drvdata(dev, NULL); 744 dev_set_drvdata(dev, NULL);
746exit: 745exit:
747 dev_err(dev, "failed to create client for %s ID 0x%lX\n", 746 dev_err(dev, "failed to create client for %s ID 0x%lX\n",
748 id->name, id->devid); 747 name, devid);
749 return err; 748 return err;
750} 749}
751EXPORT_SYMBOL(ad_dpot_probe); 750EXPORT_SYMBOL(ad_dpot_probe);
@@ -770,4 +769,3 @@ MODULE_AUTHOR("Chris Verges <chrisv@cyberswitching.com>, "
770 "Michael Hennerich <hennerich@blackfin.uclinux.org>"); 769 "Michael Hennerich <hennerich@blackfin.uclinux.org>");
771MODULE_DESCRIPTION("Digital potentiometer driver"); 770MODULE_DESCRIPTION("Digital potentiometer driver");
772MODULE_LICENSE("GPL"); 771MODULE_LICENSE("GPL");
773MODULE_VERSION(DRIVER_VERSION);