--- zzzz-none-000/linux-3.10.107/drivers/iio/light/lm3533-als.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/iio/light/lm3533-als.c 2021-02-04 17:41:59.000000000 +0000 @@ -657,7 +657,7 @@ #define ILLUMINANCE_ATTR_RO(_name) \ DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO, show_##_name, NULL) #define ILLUMINANCE_ATTR_RW(_name) \ - DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO | S_IWUSR , \ + DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO | S_IWUSR, \ show_##_name, store_##_name) /* * ALS Zone threshold-event enable @@ -847,7 +847,7 @@ return -EINVAL; } - indio_dev = iio_device_alloc(sizeof(*als)); + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*als)); if (!indio_dev) return -ENOMEM; @@ -870,7 +870,7 @@ if (als->irq) { ret = lm3533_als_setup_irq(als, indio_dev); if (ret) - goto err_free_dev; + return ret; } ret = lm3533_als_setup(als, pdata); @@ -894,8 +894,6 @@ err_free_irq: if (als->irq) free_irq(als->irq, indio_dev); -err_free_dev: - iio_device_free(indio_dev); return ret; } @@ -910,7 +908,6 @@ lm3533_als_disable(als); if (als->irq) free_irq(als->irq, indio_dev); - iio_device_free(indio_dev); return 0; } @@ -918,7 +915,6 @@ static struct platform_driver lm3533_als_driver = { .driver = { .name = "lm3533-als", - .owner = THIS_MODULE, }, .probe = lm3533_als_probe, .remove = lm3533_als_remove,