diff options
Diffstat (limited to 'drivers/misc/carma/carma-fpga-program.c')
-rw-r--r-- | drivers/misc/carma/carma-fpga-program.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c index 736c7714f565..c6bd7e84de24 100644 --- a/drivers/misc/carma/carma-fpga-program.c +++ b/drivers/misc/carma/carma-fpga-program.c | |||
@@ -830,8 +830,9 @@ static ssize_t penable_store(struct device *dev, struct device_attribute *attr, | |||
830 | unsigned long val; | 830 | unsigned long val; |
831 | int ret; | 831 | int ret; |
832 | 832 | ||
833 | if (strict_strtoul(buf, 0, &val)) | 833 | ret = kstrtoul(buf, 0, &val); |
834 | return -EINVAL; | 834 | if (ret) |
835 | return ret; | ||
835 | 836 | ||
836 | if (val) { | 837 | if (val) { |
837 | ret = fpga_enable_power_supplies(priv); | 838 | ret = fpga_enable_power_supplies(priv); |
@@ -859,8 +860,9 @@ static ssize_t program_store(struct device *dev, struct device_attribute *attr, | |||
859 | unsigned long val; | 860 | unsigned long val; |
860 | int ret; | 861 | int ret; |
861 | 862 | ||
862 | if (strict_strtoul(buf, 0, &val)) | 863 | ret = kstrtoul(buf, 0, &val); |
863 | return -EINVAL; | 864 | if (ret) |
865 | return ret; | ||
864 | 866 | ||
865 | /* We can't have an image writer and be programming simultaneously */ | 867 | /* We can't have an image writer and be programming simultaneously */ |
866 | if (mutex_lock_interruptible(&priv->lock)) | 868 | if (mutex_lock_interruptible(&priv->lock)) |
@@ -919,7 +921,7 @@ static bool dma_filter(struct dma_chan *chan, void *data) | |||
919 | 921 | ||
920 | static int fpga_of_remove(struct platform_device *op) | 922 | static int fpga_of_remove(struct platform_device *op) |
921 | { | 923 | { |
922 | struct fpga_dev *priv = dev_get_drvdata(&op->dev); | 924 | struct fpga_dev *priv = platform_get_drvdata(op); |
923 | struct device *this_device = priv->miscdev.this_device; | 925 | struct device *this_device = priv->miscdev.this_device; |
924 | 926 | ||
925 | sysfs_remove_group(&this_device->kobj, &fpga_attr_group); | 927 | sysfs_remove_group(&this_device->kobj, &fpga_attr_group); |
@@ -969,7 +971,7 @@ static int fpga_of_probe(struct platform_device *op) | |||
969 | 971 | ||
970 | kref_init(&priv->ref); | 972 | kref_init(&priv->ref); |
971 | 973 | ||
972 | dev_set_drvdata(&op->dev, priv); | 974 | platform_set_drvdata(op, priv); |
973 | priv->dev = &op->dev; | 975 | priv->dev = &op->dev; |
974 | mutex_init(&priv->lock); | 976 | mutex_init(&priv->lock); |
975 | init_completion(&priv->completion); | 977 | init_completion(&priv->completion); |