Re: [PATCH] scsi: storvsc: Fix scsi_cmd error assignments in storvsc_handle_error

2017-12-20 Thread Martin K. Petersen

Cathy,

> When an I/O is returned with an srb_status of SRB_STATUS_INVALID_LUN
> which has zero good_bytes it must be assigned an error. Otherwise the
> I/O will be continuously requeued and will cause a deadlock in the
> case where disks are being hot added and removed. sd_probe_async will
> wait forever for its I/O to complete while holding
> scsi_sd_probe_domain.
>
> Also returning the default error of DID_TARGET_FAILURE causes
> multipath to not retry the I/O resulting in applications receiving I/O
> errors before a failover can occur.

Applied to 4.15/scsi-fixes. Thank you!

-- 
Martin K. Petersen  Oracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-20 Thread Zhang Rui
On Tue, 2017-12-19 at 10:15 -0800, Joe Perches wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RO where possible.
> 
> Done with perl script:
> 
> $ git grep -w --name-only DEVICE_ATTR | \
>   xargs perl -i -e 'local $/; while (<>) {
> s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IRUGO\s*|\s*0444\s*)\)?
> \s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g; print;}'
> 
> Signed-off-by: Joe Perches 
> ---
>  arch/arm/mach-pxa/sharpsl_pm.c   |  4 ++--
>  arch/sh/drivers/push-switch.c|  2 +-
>  arch/tile/kernel/sysfs.c | 10 +-
>  drivers/acpi/device_sysfs.c  |  6 +++---
>  drivers/char/ipmi/ipmi_msghandler.c  | 17 
> -
>  drivers/gpu/drm/i915/i915_sysfs.c|  6 +++---
>  drivers/nvme/host/core.c | 10 +-
>  drivers/s390/cio/css.c   |  8 
>  drivers/s390/cio/device.c|  8 
>  drivers/s390/crypto/ap_card.c|  2 +-
>  drivers/scsi/hpsa.c  | 10 +-
>  drivers/scsi/lpfc/lpfc_attr.c| 18 
> --
>  drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c |  8 
>  drivers/thermal/thermal_sysfs.c  |  6 +++---

For the thermal part,
ACK-by: Zhang Rui 

thanks,
rui
>  sound/soc/soc-core.c |  2 +-
>  sound/soc/soc-dapm.c |  2 +-
>  16 files changed, 58 insertions(+), 61 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-
> pxa/sharpsl_pm.c
> index 398ba9ba2632..ef9fd9b759cb 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -802,8 +802,8 @@ static ssize_t battery_voltage_show(struct device
> *dev, struct device_attribute
>   return sprintf(buf, "%d\n",
> sharpsl_pm.battstat.mainbat_voltage);
>  }
>  
> -static DEVICE_ATTR(battery_percentage, 0444,
> battery_percentage_show, NULL);
> -static DEVICE_ATTR(battery_voltage, 0444, battery_voltage_show,
> NULL);
> +static DEVICE_ATTR_RO(battery_percentage);
> +static DEVICE_ATTR_RO(battery_voltage);
>  
>  extern void (*apm_get_power_status)(struct apm_power_info *);
>  
> diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-
> switch.c
> index a17181160233..762bc5619910 100644
> --- a/arch/sh/drivers/push-switch.c
> +++ b/arch/sh/drivers/push-switch.c
> @@ -24,7 +24,7 @@ static ssize_t switch_show(struct device *dev,
>   struct push_switch_platform_info *psw_info = dev-
> >platform_data;
>   return sprintf(buf, "%s\n", psw_info->name);
>  }
> -static DEVICE_ATTR(switch, S_IRUGO, switch_show, NULL);
> +static DEVICE_ATTR_RO(switch);
>  
>  static void switch_timer(struct timer_list *t)
>  {
> diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
> index af5024f0fb5a..b09456a3d77a 100644
> --- a/arch/tile/kernel/sysfs.c
> +++ b/arch/tile/kernel/sysfs.c
> @@ -38,7 +38,7 @@ static ssize_t chip_width_show(struct device *dev,
>  {
>   return sprintf(page, "%u\n", smp_width);
>  }
> -static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
> +static DEVICE_ATTR_RO(chip_width);
>  
>  static ssize_t chip_height_show(struct device *dev,
>   struct device_attribute *attr,
> @@ -46,7 +46,7 @@ static ssize_t chip_height_show(struct device *dev,
>  {
>   return sprintf(page, "%u\n", smp_height);
>  }
> -static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
> +static DEVICE_ATTR_RO(chip_height);
>  
>  static ssize_t chip_serial_show(struct device *dev,
>   struct device_attribute *attr,
> @@ -54,7 +54,7 @@ static ssize_t chip_serial_show(struct device *dev,
>  {
>   return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
>  }
> -static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
> +static DEVICE_ATTR_RO(chip_serial);
>  
>  static ssize_t chip_revision_show(struct device *dev,
>     struct device_attribute *attr,
> @@ -62,7 +62,7 @@ static ssize_t chip_revision_show(struct device
> *dev,
>  {
>   return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
>  }
> -static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
> +static DEVICE_ATTR_RO(chip_revision);
>  
>  
>  static ssize_t type_show(struct device *dev,
> @@ -71,7 +71,7 @@ static ssize_t type_show(struct device *dev,
>  {
>   return sprintf(page, "tilera\n");
>  }
> -static DEVICE_ATTR(type, 0444, type_show, NULL);
> +static DEVICE_ATTR_RO(type);
>  
>  #define HV_CONF_ATTR(name, conf) 
> \
>   static ssize_t name ## _show(struct device *dev,
> \
> diff --git a/drivers/acpi/device_sysfs.c
> b/drivers/acpi/device_sysfs.c
> index a041689e5701..545e91420cde 100644
> 

[PATCH 1/4] staging: greybus: authentication.c: Fix alignment should match open parenthesis

2017-12-20 Thread Kamal Heib
Fix "Alignment should match open parenthesis" checkpatch.pl error.

Signed-off-by: Kamal Heib 
---
 drivers/staging/greybus/authentication.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/authentication.c 
b/drivers/staging/greybus/authentication.c
index 16cc65e1472b..a5d7c53df987 100644
--- a/drivers/staging/greybus/authentication.c
+++ b/drivers/staging/greybus/authentication.c
@@ -202,7 +202,7 @@ static int cap_release(struct inode *inode, struct file 
*file)
 }
 
 static int cap_ioctl(struct gb_cap *cap, unsigned int cmd,
-void __user *buf)
+void __user *buf)
 {
struct cap_ioc_get_endpoint_uid endpoint_uid;
struct cap_ioc_get_ims_certificate *ims_cert;
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/4] staging: greybus: Cleanup checkpatch errors

2017-12-20 Thread Kamal Heib
This patch set fixes multiple error found by checkpatch.pl in the
greybus drivers.

Kamal Heib (4):
  staging: greybus: authentication.c: Fix alignment should match open
parenthesis
  staging: greybus: bootrom.c: Fix alignment should match open
parenthesis
  staging: greybus: bundle.c: Fix multiple checkpatch.pl errors
  staging: greybus: bundle.h: Use a blank line after struct declarations

 drivers/staging/greybus/authentication.c |  2 +-
 drivers/staging/greybus/bootrom.c| 26 +-
 drivers/staging/greybus/bundle.c |  4 ++--
 drivers/staging/greybus/bundle.h |  1 +
 4 files changed, 17 insertions(+), 16 deletions(-)

-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: greybus: bootrom.c: Fix alignment should match open parenthesis

2017-12-20 Thread Kamal Heib
Fix "Alignment should match open parenthesis" checkpatch.pl error.

Signed-off-by: Kamal Heib 
---
 drivers/staging/greybus/bootrom.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/greybus/bootrom.c 
b/drivers/staging/greybus/bootrom.c
index e85ffae85dff..c7c9f83c28c4 100644
--- a/drivers/staging/greybus/bootrom.c
+++ b/drivers/staging/greybus/bootrom.c
@@ -86,7 +86,8 @@ static void gb_bootrom_timedout(struct work_struct *work)
 }
 
 static void gb_bootrom_set_timeout(struct gb_bootrom *bootrom,
-   enum next_request_type next, unsigned long timeout)
+  enum next_request_type next,
+  unsigned long timeout)
 {
bootrom->next_request = next;
schedule_delayed_work(>dwork, msecs_to_jiffies(timeout));
@@ -175,7 +176,7 @@ static int find_firmware(struct gb_bootrom *bootrom, u8 
stage)
 firmware_name);
 
rc = request_firmware(>fw, firmware_name,
-   >bundle->dev);
+ >bundle->dev);
if (rc) {
dev_err(>bundle->dev,
"failed to find %s firmware (%d)\n", firmware_name, rc);
@@ -274,7 +275,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op)
 
if (offset >= fw->size || size > fw->size - offset) {
dev_warn(dev, "bad firmware request (offs = %u, size = %u)\n",
-   offset, size);
+offset, size);
ret = -EINVAL;
goto unlock;
}
@@ -386,16 +387,15 @@ static int gb_bootrom_get_version(struct gb_bootrom 
*bootrom)
, sizeof(request), ,
sizeof(response));
if (ret) {
-   dev_err(>dev,
-   "failed to get protocol version: %d\n",
-   ret);
+   dev_err(>dev, "failed to get protocol version: %d\n",
+   ret);
return ret;
}
 
if (response.major > request.major) {
dev_err(>dev,
-   "unsupported major protocol version (%u > 
%u)\n",
-   response.major, request.major);
+   "unsupported major protocol version (%u > %u)\n",
+   response.major, request.major);
return -ENOTSUPP;
}
 
@@ -403,13 +403,13 @@ static int gb_bootrom_get_version(struct gb_bootrom 
*bootrom)
bootrom->protocol_minor = response.minor;
 
dev_dbg(>dev, "%s - %u.%u\n", __func__, response.major,
-   response.minor);
+   response.minor);
 
return 0;
 }
 
 static int gb_bootrom_probe(struct gb_bundle *bundle,
-   const struct greybus_bundle_id *id)
+   const struct greybus_bundle_id *id)
 {
struct greybus_descriptor_cport *cport_desc;
struct gb_connection *connection;
@@ -428,8 +428,8 @@ static int gb_bootrom_probe(struct gb_bundle *bundle,
return -ENOMEM;
 
connection = gb_connection_create(bundle,
-   le16_to_cpu(cport_desc->id),
-   gb_bootrom_request_handler);
+ le16_to_cpu(cport_desc->id),
+ gb_bootrom_request_handler);
if (IS_ERR(connection)) {
ret = PTR_ERR(connection);
goto err_free_bootrom;
@@ -466,7 +466,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle,
NULL, 0);
if (ret) {
dev_err(>bundle->dev,
-   "failed to send AP READY: %d\n", ret);
+   "failed to send AP READY: %d\n", ret);
goto err_cancel_timeout;
}
 
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: greybus: bundle.c: Fix multiple checkpatch.pl errors

2017-12-20 Thread Kamal Heib
CHECK: Comparison to NULL could be written "!bundle->state"
+   if (bundle->state == NULL)

CHECK: Alignment should match open parenthesis
+static struct gb_bundle *gb_bundle_find(struct gb_interface *intf,
+   u8 bundle_id)

Signed-off-by: Kamal Heib 
---
 drivers/staging/greybus/bundle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index 81c018da1248..3f702db9e098 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct 
device_attribute *attr,
 {
struct gb_bundle *bundle = to_gb_bundle(dev);
 
-   if (bundle->state == NULL)
+   if (!bundle->state)
return sprintf(buf, "\n");
 
return sprintf(buf, "%s\n", bundle->state);
@@ -65,7 +65,7 @@ static struct attribute *bundle_attrs[] = {
 ATTRIBUTE_GROUPS(bundle);
 
 static struct gb_bundle *gb_bundle_find(struct gb_interface *intf,
-   u8 bundle_id)
+   u8 bundle_id)
 {
struct gb_bundle *bundle;
 
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: greybus: bundle.h: Use a blank line after struct declarations

2017-12-20 Thread Kamal Heib
Fix the following error found by checkpatch.pl:

CHECK: Please use a blank line after function/struct/union/enum declarations
+};
+#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)

Signed-off-by: Kamal Heib 
---
 drivers/staging/greybus/bundle.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/greybus/bundle.h b/drivers/staging/greybus/bundle.h
index ffcfd43802cc..a69200c786d0 100644
--- a/drivers/staging/greybus/bundle.h
+++ b/drivers/staging/greybus/bundle.h
@@ -31,6 +31,7 @@ struct gb_bundle {
 
struct list_headlinks;  /* interface->bundles */
 };
+
 #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
 
 /* Greybus "private" definitions" */
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-20 Thread Robert Jarzmik
"Rafael J. Wysocki"  writes:

> On Tuesday, December 19, 2017 7:15:08 PM CET Joe Perches wrote:
>> Convert DEVICE_ATTR uses to DEVICE_ATTR_RO where possible.
>> 
>> Done with perl script:
>> 
>> $ git grep -w --name-only DEVICE_ATTR | \
>>   xargs perl -i -e 'local $/; while (<>) { 
>> s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IRUGO\s*|\s*0444\s*)\)?\s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g;
>>  print;}'
>> 
>> Signed-off-by: Joe Perches 
>> ---
>>  arch/arm/mach-pxa/sharpsl_pm.c   |  4 ++--

For mach-pxa:
Acked-by: Robert Jarzmik 

Cheers.

--
Robert
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-20 Thread Sagi Grimberg

for the NVMe bits,

Acked-by: Sagi Grimberg 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 4/4] ARM: dts: tegra20: Add video decoder node

2017-12-20 Thread Thierry Reding
On Tue, Dec 12, 2017 at 03:26:10AM +0300, Dmitry Osipenko wrote:
> Add Video Decoder Engine device node.
> 
> Signed-off-by: Dmitry Osipenko 
> ---
>  arch/arm/boot/dts/tegra20.dtsi | 27 +++
>  1 file changed, 27 insertions(+)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 3/4] ARM: dts: tegra20: Add device tree node to describe IRAM

2017-12-20 Thread Thierry Reding
On Tue, Dec 12, 2017 at 03:26:09AM +0300, Dmitry Osipenko wrote:
> From: Vladimir Zapolskiy 
> 
> All Tegra20 SoCs contain 256KiB IRAM, which is used to store
> resume code and by a video decoder engine.
> 
> Signed-off-by: Vladimir Zapolskiy 
> Signed-off-by: Dmitry Osipenko 
> ---
>  arch/arm/boot/dts/tegra20.dtsi | 8 
>  1 file changed, 8 insertions(+)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-20 Thread Rafael J. Wysocki
On Tuesday, December 19, 2017 7:15:08 PM CET Joe Perches wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RO where possible.
> 
> Done with perl script:
> 
> $ git grep -w --name-only DEVICE_ATTR | \
>   xargs perl -i -e 'local $/; while (<>) { 
> s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IRUGO\s*|\s*0444\s*)\)?\s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g;
>  print;}'
> 
> Signed-off-by: Joe Perches 
> ---
>  arch/arm/mach-pxa/sharpsl_pm.c   |  4 ++--
>  arch/sh/drivers/push-switch.c|  2 +-
>  arch/tile/kernel/sysfs.c | 10 +-
>  drivers/acpi/device_sysfs.c  |  6 +++---
>  drivers/char/ipmi/ipmi_msghandler.c  | 17 -
>  drivers/gpu/drm/i915/i915_sysfs.c|  6 +++---
>  drivers/nvme/host/core.c | 10 +-
>  drivers/s390/cio/css.c   |  8 
>  drivers/s390/cio/device.c|  8 
>  drivers/s390/crypto/ap_card.c|  2 +-
>  drivers/scsi/hpsa.c  | 10 +-
>  drivers/scsi/lpfc/lpfc_attr.c| 18 --
>  drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c |  8 
>  drivers/thermal/thermal_sysfs.c  |  6 +++---
>  sound/soc/soc-core.c |  2 +-
>  sound/soc/soc-dapm.c |  2 +-
>  16 files changed, 58 insertions(+), 61 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index 398ba9ba2632..ef9fd9b759cb 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -802,8 +802,8 @@ static ssize_t battery_voltage_show(struct device *dev, 
> struct device_attribute
>   return sprintf(buf, "%d\n", sharpsl_pm.battstat.mainbat_voltage);
>  }
>  
> -static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL);
> -static DEVICE_ATTR(battery_voltage, 0444, battery_voltage_show, NULL);
> +static DEVICE_ATTR_RO(battery_percentage);
> +static DEVICE_ATTR_RO(battery_voltage);
>  
>  extern void (*apm_get_power_status)(struct apm_power_info *);
>  
> diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c
> index a17181160233..762bc5619910 100644
> --- a/arch/sh/drivers/push-switch.c
> +++ b/arch/sh/drivers/push-switch.c
> @@ -24,7 +24,7 @@ static ssize_t switch_show(struct device *dev,
>   struct push_switch_platform_info *psw_info = dev->platform_data;
>   return sprintf(buf, "%s\n", psw_info->name);
>  }
> -static DEVICE_ATTR(switch, S_IRUGO, switch_show, NULL);
> +static DEVICE_ATTR_RO(switch);
>  
>  static void switch_timer(struct timer_list *t)
>  {
> diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
> index af5024f0fb5a..b09456a3d77a 100644
> --- a/arch/tile/kernel/sysfs.c
> +++ b/arch/tile/kernel/sysfs.c
> @@ -38,7 +38,7 @@ static ssize_t chip_width_show(struct device *dev,
>  {
>   return sprintf(page, "%u\n", smp_width);
>  }
> -static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
> +static DEVICE_ATTR_RO(chip_width);
>  
>  static ssize_t chip_height_show(struct device *dev,
>   struct device_attribute *attr,
> @@ -46,7 +46,7 @@ static ssize_t chip_height_show(struct device *dev,
>  {
>   return sprintf(page, "%u\n", smp_height);
>  }
> -static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
> +static DEVICE_ATTR_RO(chip_height);
>  
>  static ssize_t chip_serial_show(struct device *dev,
>   struct device_attribute *attr,
> @@ -54,7 +54,7 @@ static ssize_t chip_serial_show(struct device *dev,
>  {
>   return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
>  }
> -static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
> +static DEVICE_ATTR_RO(chip_serial);
>  
>  static ssize_t chip_revision_show(struct device *dev,
> struct device_attribute *attr,
> @@ -62,7 +62,7 @@ static ssize_t chip_revision_show(struct device *dev,
>  {
>   return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
>  }
> -static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
> +static DEVICE_ATTR_RO(chip_revision);
>  
>  
>  static ssize_t type_show(struct device *dev,
> @@ -71,7 +71,7 @@ static ssize_t type_show(struct device *dev,
>  {
>   return sprintf(page, "tilera\n");
>  }
> -static DEVICE_ATTR(type, 0444, type_show, NULL);
> +static DEVICE_ATTR_RO(type);
>  
>  #define HV_CONF_ATTR(name, conf) \
>   static ssize_t name ## _show(struct device *dev,\
> diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
> index a041689e5701..545e91420cde 100644
> --- a/drivers/acpi/device_sysfs.c
> +++ b/drivers/acpi/device_sysfs.c
> @@ -357,7 +357,7 @@ 

[PATCH] staging: ccree: fix __dump_byte_array() declaration mismatch

2017-12-20 Thread Corentin Labbe
This patch corrects the type of the size argument in __dump_byte_array()
from unsigned long to size_t as done only in drivers/staging/ccree/ssi_driver.c

This fix also a build error:
drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for 
'__dump_byte_array'

Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
Signed-off-by: Corentin Labbe 
---
 drivers/staging/ccree/ssi_driver.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/ccree/ssi_driver.h 
b/drivers/staging/ccree/ssi_driver.h
index 5a56f7a76b71..0f57c9a8b8a6 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -174,8 +174,7 @@ static inline struct device *drvdata_to_dev(struct 
cc_drvdata *drvdata)
return >plat_dev->dev;
 }
 
-void __dump_byte_array(const char *name, const u8 *the_array,
-  unsigned long size);
+void __dump_byte_array(const char *name, const u8 *buf, size_t size);
 static inline void dump_byte_array(const char *name, const u8 *the_array,
   unsigned long size)
 {
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v1 2/4] lib/net_utils: Introduce mac_pton_from_user()

2017-12-20 Thread David Miller
From: Greg Kroah-Hartman 
Date: Wed, 20 Dec 2017 08:13:55 +0100

> On Tue, Dec 19, 2017 at 09:14:10PM +0200, Andy Shevchenko wrote:
>> Some drivers are getting MAC from user space. Make a helper for them.
>> 
>> Signed-off-by: Andy Shevchenko 
>> ---
>>  include/linux/kernel.h |  1 +
>>  lib/net_utils.c| 12 
>>  2 files changed, 13 insertions(+)
> 
> Don't do this just for some horrid staging drivers.  They can just drop
> that functionality entirely and use the "normal" way of doing this if
> they really want it.

Agreed.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 9/9] staging: pi433: remove unused rf69_set_dc_cut_off_frequency* functions

2017-12-20 Thread Marcin Ciupak
The following functions:
* rf69_set_dc_cut_off_frequency,
* rf69_set_dc_cut_off_frequency_intern,
* rf69_set_dc_cut_off_frequency_during_afc
are unused and should be removed along with type enum dcc_percent which
was used only by these functions.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c  | 27 ---
 drivers/staging/pi433/rf69.h  |  3 ---
 drivers/staging/pi433/rf69_enum.h | 11 ---
 3 files changed, 41 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index a1e2069b3ae1..93b1a9cb2c65 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -380,33 +380,6 @@ int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain 
lnaGain)
}
 }
 
-int rf69_set_dc_cut_off_frequency_intern(struct spi_device *spi, u8 reg, enum 
dcc_percent dcc_percent)
-{
-   switch (dcc_percent) {
-   case dcc_16_percent:return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_16_PERCENT);
-   case dcc_8_percent: return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_8_PERCENT);
-   case dcc_4_percent: return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_4_PERCENT);
-   case dcc_2_percent: return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_2_PERCENT);
-   case dcc_1_percent: return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_1_PERCENT);
-   case dcc_0_5_percent:   return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_0_5_PERCENT);
-   case dcc_0_25_percent:  return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_0_25_PERCENT);
-   case dcc_0_125_percent: return rf69_read_mod_write(spi, reg, 
MASK_BW_DCC_FREQ, BW_DCC_0_125_PERCENT);
-   default:
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-}
-
-int rf69_set_dc_cut_off_frequency(struct spi_device *spi, enum dcc_percent 
dcc_percent)
-{
-   return rf69_set_dc_cut_off_frequency_intern(spi, REG_RXBW, dcc_percent);
-}
-
-int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum 
dcc_percent dcc_percent)
-{
-   return rf69_set_dc_cut_off_frequency_intern(spi, REG_AFCBW, 
dcc_percent);
-}
-
 static int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg,
 enum mantisse mantisse, u8 exponent)
 {
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 4dc7234f0acf..85185ca925ba 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -38,9 +38,6 @@ int rf69_set_output_power_level(struct spi_device *spi, u8 
powerLevel);
 int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp);
 int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance 
antennaImpedance);
 int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain);
-int rf69_set_dc_cut_off_frequency_intern(struct spi_device *spi, u8 reg, enum 
dcc_percent dcc_percent);
-int rf69_set_dc_cut_off_frequency(struct spi_device *spi, enum dcc_percent 
dcc_percent);
-int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum 
dcc_percent dcc_percent);
 int rf69_set_bandwidth(struct spi_device *spi, enum mantisse mantisse, u8 
exponent);
 int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse 
mantisse, u8 exponent);
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
diff --git a/drivers/staging/pi433/rf69_enum.h 
b/drivers/staging/pi433/rf69_enum.h
index 407e037bfe10..359a74ff099c 100644
--- a/drivers/staging/pi433/rf69_enum.h
+++ b/drivers/staging/pi433/rf69_enum.h
@@ -76,17 +76,6 @@ enum lnaGain {
undefined
 };
 
-enum dcc_percent {
-   dcc_16_percent,
-   dcc_8_percent,
-   dcc_4_percent,
-   dcc_2_percent,
-   dcc_1_percent,
-   dcc_0_5_percent,
-   dcc_0_25_percent,
-   dcc_0_125_percent
-};
-
 enum mantisse {
mantisse16,
mantisse20,
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 8/9] staging: pi433: remove unused rf69_set_ook_threshold_type function

2017-12-20 Thread Marcin Ciupak
Function rf69_set_ook_threshold_type is unused and should be removed
along with type enum thresholdType which was used only by that function.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c  | 12 
 drivers/staging/pi433/rf69.h  |  1 -
 drivers/staging/pi433/rf69_enum.h |  6 --
 3 files changed, 19 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 9bd820f308e4..a1e2069b3ae1 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -461,18 +461,6 @@ int rf69_set_bandwidth_during_afc(struct spi_device *spi, 
enum mantisse mantisse
return rf69_set_bandwidth_intern(spi, REG_AFCBW, mantisse, exponent);
 }
 
-int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType 
thresholdType)
-{
-   switch (thresholdType) {
-   case fixed: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESTYPE, OOKPEAK_THRESHTYPE_FIXED);
-   case peak:  return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESTYPE, OOKPEAK_THRESHTYPE_PEAK);
-   case average:   return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESTYPE, OOKPEAK_THRESHTYPE_AVERAGE);
-   default:
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-}
-
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement)
 {
switch (thresholdDecrement) {
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 508bb794e525..4dc7234f0acf 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -43,7 +43,6 @@ int rf69_set_dc_cut_off_frequency(struct spi_device *spi, 
enum dcc_percent dcc_p
 int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum 
dcc_percent dcc_percent);
 int rf69_set_bandwidth(struct spi_device *spi, enum mantisse mantisse, u8 
exponent);
 int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse 
mantisse, u8 exponent);
-int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType 
thresholdType);
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
 int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
diff --git a/drivers/staging/pi433/rf69_enum.h 
b/drivers/staging/pi433/rf69_enum.h
index e18014218ae5..407e037bfe10 100644
--- a/drivers/staging/pi433/rf69_enum.h
+++ b/drivers/staging/pi433/rf69_enum.h
@@ -93,12 +93,6 @@ enum mantisse {
mantisse24
 };
 
-enum thresholdType {
-   fixed,
-   peak,
-   average
-};
-
 enum thresholdDecrement {
dec_every8th,
dec_every4th,
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 7/9] staging: pi433: remove unused rf69_set_ook_threshold_step function

2017-12-20 Thread Marcin Ciupak
Function rf69_set_ook_threshold_step is unused and should be removed
along with type enum thresholdStep which was used only by that function.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c  | 17 -
 drivers/staging/pi433/rf69.h  |  1 -
 drivers/staging/pi433/rf69_enum.h | 11 ---
 3 files changed, 29 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e7147d6b8bc5..9bd820f308e4 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -473,23 +473,6 @@ int rf69_set_ook_threshold_type(struct spi_device *spi, 
enum thresholdType thres
}
 }
 
-int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep 
thresholdStep)
-{
-   switch (thresholdStep) {
-   case step_0_5db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_0_5_DB);
-   case step_1_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_1_0_DB);
-   case step_1_5db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_1_5_DB);
-   case step_2_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_2_0_DB);
-   case step_3_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_3_0_DB);
-   case step_4_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_4_0_DB);
-   case step_5_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_5_0_DB);
-   case step_6_0db: return rf69_read_mod_write(spi, REG_OOKPEAK, 
MASK_OOKPEAK_THRESSTEP, OOKPEAK_THRESHSTEP_6_0_DB);
-   default:
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-}
-
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement)
 {
switch (thresholdDecrement) {
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index c586cb12c12d..508bb794e525 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -44,7 +44,6 @@ int rf69_set_dc_cut_off_frequency_during_afc(struct 
spi_device *spi, enum dcc_pe
 int rf69_set_bandwidth(struct spi_device *spi, enum mantisse mantisse, u8 
exponent);
 int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse 
mantisse, u8 exponent);
 int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType 
thresholdType);
-int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep 
thresholdStep);
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
 int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
diff --git a/drivers/staging/pi433/rf69_enum.h 
b/drivers/staging/pi433/rf69_enum.h
index dd33126817b6..e18014218ae5 100644
--- a/drivers/staging/pi433/rf69_enum.h
+++ b/drivers/staging/pi433/rf69_enum.h
@@ -99,17 +99,6 @@ enum thresholdType {
average
 };
 
-enum thresholdStep {
-   step_0_5db,
-   step_1_0db,
-   step_1_5db,
-   step_2_0db,
-   step_3_0db,
-   step_4_0db,
-   step_5_0db,
-   step_6_0db
-};
-
 enum thresholdDecrement {
dec_every8th,
dec_every4th,
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/9] staging: pi433: remove unused rf69_reset_flag function

2017-12-20 Thread Marcin Ciupak
Function rf69_reset_flag is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 12 
 drivers/staging/pi433/rf69.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e3d0a4bca380..e7147d6b8bc5 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -572,18 +572,6 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
}
 }
 
-int rf69_reset_flag(struct spi_device *spi, enum flag flag)
-{
-   switch (flag) {
-   case rssiExceededThreshold: return rf69_write_reg(spi, REG_IRQFLAGS1, 
MASK_IRQFLAGS1_RSSI);
-   case syncAddressMatch:  return rf69_write_reg(spi, REG_IRQFLAGS1, 
MASK_IRQFLAGS1_SYNC_ADDRESS_MATCH);
-   case fifoOverrun:   return rf69_write_reg(spi, REG_IRQFLAGS2, 
MASK_IRQFLAGS2_FIFO_OVERRUN);
-   default:
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-}
-
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold)
 {
/* no value check needed - u8 exactly matches register size */
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 6a5e8982e7cf..c586cb12c12d 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -48,7 +48,6 @@ int rf69_set_ook_threshold_step(struct spi_device *spi, enum 
thresholdStep thres
 int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
 int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
-int rf69_reset_flag(struct spi_device *spi, enum flag flag);
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold);
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength);
 int rf69_enable_sync(struct spi_device *spi);
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/9] staging: pi433: remove unused rf69_set_rssi_timeout function

2017-12-20 Thread Marcin Ciupak
Function rf69_set_rssi_timeout is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 7 ---
 drivers/staging/pi433/rf69.h | 1 -
 2 files changed, 8 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 33a0e00852dc..25dfd8d40a47 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -598,13 +598,6 @@ int rf69_set_rx_start_timeout(struct spi_device *spi, u8 
timeout)
return rf69_write_reg(spi, REG_RXTIMEOUT1, timeout);
 }
 
-int rf69_set_rssi_timeout(struct spi_device *spi, u8 timeout)
-{
-   /* no value check needed - u8 exactly matches register size */
-
-   return rf69_write_reg(spi, REG_RXTIMEOUT2, timeout);
-}
-
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength)
 {
int retval;
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 271fc178ca07..592de97ea69f 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -51,7 +51,6 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag);
 int rf69_reset_flag(struct spi_device *spi, enum flag flag);
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold);
 int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout);
-int rf69_set_rssi_timeout(struct spi_device *spi, u8 timeout);
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength);
 int rf69_enable_sync(struct spi_device *spi);
 int rf69_disable_sync(struct spi_device *spi);
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/9] staging: pi433: remove unused rf69_set_rx_start_timeout function

2017-12-20 Thread Marcin Ciupak
Function rf69_set_rx_start_timeout is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 7 ---
 drivers/staging/pi433/rf69.h | 1 -
 2 files changed, 8 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 25dfd8d40a47..e3d0a4bca380 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -591,13 +591,6 @@ int rf69_set_rssi_threshold(struct spi_device *spi, u8 
threshold)
return rf69_write_reg(spi, REG_RSSITHRESH, threshold);
 }
 
-int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout)
-{
-   /* no value check needed - u8 exactly matches register size */
-
-   return rf69_write_reg(spi, REG_RXTIMEOUT1, timeout);
-}
-
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength)
 {
int retval;
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 592de97ea69f..6a5e8982e7cf 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -50,7 +50,6 @@ int rf69_set_dio_mapping(struct spi_device *spi, u8 
DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
 int rf69_reset_flag(struct spi_device *spi, enum flag flag);
 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold);
-int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout);
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength);
 int rf69_enable_sync(struct spi_device *spi);
 int rf69_disable_sync(struct spi_device *spi);
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/9] staging: pi433: remove unused rf69_set_sync_tolerance function

2017-12-20 Thread Marcin Ciupak
Function rf69_set_sync_tolerance is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 12 
 drivers/staging/pi433/rf69.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 507092c44f2e..33a0e00852dc 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -658,18 +658,6 @@ int rf69_set_sync_size(struct spi_device *spi, u8 syncSize)
return rf69_read_mod_write(spi, REG_SYNC_CONFIG, 
MASK_SYNC_CONFIG_SYNC_SIZE, (syncSize << 3));
 }
 
-int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance)
-{
-   // check input value
-   if (syncTolerance > 0x07) {
-   dev_dbg(>dev, "set: illegal input param");
-   return -EINVAL;
-   }
-
-   // write value
-   return rf69_read_mod_write(spi, REG_SYNC_CONFIG, 
MASK_SYNC_CONFIG_SYNC_SIZE, syncTolerance);
-}
-
 int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8])
 {
int retval = 0;
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index e5439ad5d141..271fc178ca07 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -57,7 +57,6 @@ int rf69_enable_sync(struct spi_device *spi);
 int rf69_disable_sync(struct spi_device *spi);
 int rf69_set_fifo_fill_condition(struct spi_device *spi, enum 
fifoFillCondition fifoFillCondition);
 int rf69_set_sync_size(struct spi_device *spi, u8 sync_size);
-int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance);
 int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8]);
 int rf69_set_packet_format(struct spi_device *spi, enum packetFormat 
packetFormat);
 int rf69_enable_crc(struct spi_device *spi);
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/9] staging: pi433: remove unused rf69_get_payload_length function

2017-12-20 Thread Marcin Ciupak
Function rf69_get_payload_length is unused and should be removed.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 5 -
 drivers/staging/pi433/rf69.h | 1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 043139730382..507092c44f2e 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -724,11 +724,6 @@ int rf69_set_payload_length(struct spi_device *spi, u8 
payloadLength)
return rf69_write_reg(spi, REG_PAYLOAD_LENGTH, payloadLength);
 }
 
-u8  rf69_get_payload_length(struct spi_device *spi)
-{
-   return (u8)rf69_read_reg(spi, REG_PAYLOAD_LENGTH);
-}
-
 int rf69_set_node_address(struct spi_device *spi, u8 nodeAddress)
 {
return rf69_write_reg(spi, REG_NODEADRS, nodeAddress);
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index 20af63927861..e5439ad5d141 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -64,7 +64,6 @@ int rf69_enable_crc(struct spi_device *spi);
 int rf69_disable_crc(struct spi_device *spi);
 int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering 
addressFiltering);
 int rf69_set_payload_length(struct spi_device *spi, u8 payloadLength);
-u8  rf69_get_payload_length(struct spi_device *spi);
 int rf69_set_node_address(struct spi_device *spi, u8 nodeAddress);
 int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress);
 int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition 
txStartCondition);
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/9] staging: pi433: make local functions static

2017-12-20 Thread Marcin Ciupak
Following functions:
* rf69_get_modulation
* rf69_read_reg
* rf69_write_reg
are used locally only and should be declared as static

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/pi433/rf69.c | 94 ++--
 drivers/staging/pi433/rf69.h |  3 --
 2 files changed, 47 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index f58b925bb1da..043139730382 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -33,6 +33,52 @@
 
 /*-*/
 
+static u8 rf69_read_reg(struct spi_device *spi, u8 addr)
+{
+   int retval;
+
+   retval = spi_w8r8(spi, addr);
+
+#ifdef DEBUG_VALUES
+   if (retval < 0)
+   /* should never happen, since we already checked,
+* that module is connected. Therefore no error
+* handling, just an optional error message...
+*/
+   dev_dbg(>dev, "read 0x%x FAILED\n", addr);
+   else
+   dev_dbg(>dev, "read 0x%x from reg 0x%x\n", retval, addr);
+#endif
+
+   return retval;
+}
+
+static int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value)
+{
+   int retval;
+   char buffer[2];
+
+   buffer[0] = addr | WRITE_BIT;
+   buffer[1] = value;
+
+   retval = spi_write(spi, , 2);
+
+#ifdef DEBUG_VALUES
+   if (retval < 0)
+   /* should never happen, since we already checked,
+* that module is connected. Therefore no error
+* handling, just an optional error message...
+*/
+   dev_dbg(>dev, "write 0x%x to 0x%x FAILED\n", value, addr);
+   else
+   dev_dbg(>dev, "wrote 0x%x to reg 0x%x\n", value, addr);
+#endif
+
+   return retval;
+}
+
+/*-*/
+
 static int rf69_set_bit(struct spi_device *spi, u8 reg, u8 mask)
 {
u8 tmp;
@@ -96,7 +142,7 @@ int rf69_set_modulation(struct spi_device *spi, enum 
modulation modulation)
}
 }
 
-enum modulation rf69_get_modulation(struct spi_device *spi)
+static enum modulation rf69_get_modulation(struct spi_device *spi)
 {
u8 currentValue;
 
@@ -796,49 +842,3 @@ int rf69_write_fifo(struct spi_device *spi, u8 *buffer, 
unsigned int size)
return spi_write(spi, local_buffer, size + 1);
 }
 
-/*-*/
-
-u8 rf69_read_reg(struct spi_device *spi, u8 addr)
-{
-   int retval;
-
-   retval = spi_w8r8(spi, addr);
-
-#ifdef DEBUG_VALUES
-   if (retval < 0)
-   /* should never happen, since we already checked,
-* that module is connected. Therefore no error
-* handling, just an optional error message...
-*/
-   dev_dbg(>dev, "read 0x%x FAILED\n", addr);
-   else
-   dev_dbg(>dev, "read 0x%x from reg 0x%x\n", retval, addr);
-#endif
-
-   return retval;
-}
-
-int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value)
-{
-   int retval;
-   char buffer[2];
-
-   buffer[0] = addr | WRITE_BIT;
-   buffer[1] = value;
-
-   retval = spi_write(spi, , 2);
-
-#ifdef DEBUG_VALUES
-   if (retval < 0)
-   /* should never happen, since we already checked,
-* that module is connected. Therefore no error
-* handling, just an optional error message...
-*/
-   dev_dbg(>dev, "write 0x%x to 0x%x FAILED\n", value, addr);
-   else
-   dev_dbg(>dev, "wrote 0x%x to reg 0x%x\n", value, addr);
-#endif
-
-   return retval;
-}
-
diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index e90228a0ca29..20af63927861 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -28,7 +28,6 @@
 int rf69_set_mode(struct spi_device *spi, enum mode mode);
 int rf69_set_data_mode(struct spi_device *spi, u8 data_mode);
 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
-enum modulation rf69_get_modulation(struct spi_device *spi);
 int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping 
mod_shaping);
 int rf69_set_bit_rate(struct spi_device *spi, u16 bitRate);
 int rf69_set_deviation(struct spi_device *spi, u32 deviation);
@@ -75,6 +74,4 @@ int rf69_set_dagc(struct spi_device *spi, enum dagc dagc);
 int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
 int rf69_write_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
 
-u8  rf69_read_reg(struct spi_device *spi, u8 addr);
-int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value);
 #endif
-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org

[PATCH 0/9] staging: pi433: local and unused functions cleanup

2017-12-20 Thread Marcin Ciupak
These patches make local functions static and remove unused ones. Each
function is removed by separate patch in order to make it easier to
revert patch in future if the function will be needed in later version
of the driver.

Marcin Ciupak (9):
  staging: pi433: make local functions static
  staging: pi433: remove unused rf69_get_payload_length function
  staging: pi433: remove unused rf69_set_sync_tolerance function
  staging: pi433: remove unused rf69_set_rssi_timeout function
  staging: pi433: remove unused rf69_set_rx_start_timeout function
  staging: pi433: remove unused rf69_reset_flag function
  staging: pi433: remove unused rf69_set_ook_threshold_step function
  staging: pi433: remove unused rf69_set_ook_threshold_type function
  staging: pi433: remove unused rf69_set_dc_cut_off_frequency* functions

 drivers/staging/pi433/rf69.c  | 193 ++
 drivers/staging/pi433/rf69.h  |  13 ---
 drivers/staging/pi433/rf69_enum.h |  28 --
 3 files changed, 47 insertions(+), 187 deletions(-)

-- 
2.15.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/8] media: v4l2-async: simplify v4l2_async_subdev structure

2017-12-20 Thread Lad, Prabhakar
Hi Mauro,

Thanks for the patch.

On Tue, Dec 19, 2017 at 11:18 AM, Mauro Carvalho Chehab
 wrote:
> The V4L2_ASYNC_MATCH_FWNODE match criteria requires just one
> struct to be filled (struct fwnode_handle). The V4L2_ASYNC_MATCH_DEVNAME
> match criteria requires just a device name.
>
> So, it doesn't make sense to enclose those into structs,
> as the criteria can go directly into the union.
>
> That makes easier to document it, as we don't need to document
> weird senseless structs.
>
> At drivers, this makes even clearer about the match criteria.
>
> Acked-by: Sylwester Nawrocki 
> Acked-by: Benoit Parrot 
> Acked-by: Alexandre Belloni 
> Acked-by: Sakari Ailus 
> Acked-by: Philipp Zabel 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/media/platform/am437x/am437x-vpfe.c|  6 +++---

For above:

Acked-by: Lad, Prabhakar 

Cheers,
--Prabhakar Lad
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: vchiq_arm: Cleaning up codestyle warnings

2017-12-20 Thread Mikhail Shvetsov
This removes checkpatch.pl warnings:
WARNING: line over 80 characters

Signed-off-by: Mikhail Shvetsov 
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
index 3c9f97d60019..43c89a08bda9 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
@@ -90,7 +90,8 @@ VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T 
*instance_out)
goto failed;
} else if (i > 0) {
vchiq_log_warning(vchiq_core_log_level,
-   "%s: videocore initialized after %d retries\n", 
__func__, i);
+   "%s: videocore initialized after %d retries\n",
+   __func__, i);
}
 
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: vchiq_arm: Remove useless comments.

2017-12-20 Thread Mikhail Shvetsov
This removes useless comments duplicate function names.

Signed-off-by: Mikhail Shvetsov 
---
 .../interface/vchiq_arm/vchiq_kern_lib.c   | 35 --
 1 file changed, 35 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
index 34f746db19cd..6152596d23ea 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
@@ -64,11 +64,6 @@ static VCHIQ_STATUS_T
 vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
unsigned int size, VCHIQ_BULK_DIR_T dir);
 
-/
-*
-*   vchiq_initialise
-*
-***/
 #define VCHIQ_INIT_RETRIES 10
 VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out)
 {
@@ -120,12 +115,6 @@ VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T 
*instance_out)
 }
 EXPORT_SYMBOL(vchiq_initialise);
 
-/
-*
-*   vchiq_shutdown
-*
-***/
-
 VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
 {
VCHIQ_STATUS_T status;
@@ -168,23 +157,11 @@ VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
 }
 EXPORT_SYMBOL(vchiq_shutdown);
 
-/
-*
-*   vchiq_is_connected
-*
-***/
-
 static int vchiq_is_connected(VCHIQ_INSTANCE_T instance)
 {
return instance->connected;
 }
 
-/
-*
-*   vchiq_connect
-*
-***/
-
 VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance)
 {
VCHIQ_STATUS_T status;
@@ -214,12 +191,6 @@ VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance)
 }
 EXPORT_SYMBOL(vchiq_connect);
 
-/
-*
-*   vchiq_add_service
-*
-***/
-
 VCHIQ_STATUS_T vchiq_add_service(
VCHIQ_INSTANCE_T  instance,
const VCHIQ_SERVICE_PARAMS_T *params,
@@ -259,12 +230,6 @@ VCHIQ_STATUS_T vchiq_add_service(
 }
 EXPORT_SYMBOL(vchiq_add_service);
 
-/
-*
-*   vchiq_open_service
-*
-***/
-
 VCHIQ_STATUS_T vchiq_open_service(
VCHIQ_INSTANCE_T  instance,
const VCHIQ_SERVICE_PARAMS_T *params,
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: vchiq_arm: Fixing code style of comments

2017-12-20 Thread Mikhail Shvetsov
This removes checkpatch.pl warnings:

WARNING: Block comments use a trailing */ on a separate line
WARNING: Block comments should align the * on each line
WARNING: Block comments use * on subsequent lines

Signed-off-by: Mikhail Shvetsov 
---
 .../vc04_services/interface/vchiq_arm/vchiq_kern_lib.c   | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
index 6152596d23ea..3c9f97d60019 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
@@ -75,7 +75,9 @@ VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T 
*instance_out)
vchiq_log_trace(vchiq_core_log_level, "%s called", __func__);
 
/* VideoCore may not be ready due to boot up timing.
-  It may never be ready if kernel and firmware are mismatched, so 
don't block forever. */
+* It may never be ready if kernel and firmware are mismatched,so don't
+* block forever.
+*/
for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
state = vchiq_get_state();
if (state)
@@ -379,8 +381,9 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, 
void *data,
if ((bulk->data != data) ||
(bulk->size != size)) {
/* This is not a retry of the previous one.
-   ** Cancel the signal when the transfer
-   ** completes. */
+* Cancel the signal when the transfer
+* completes.
+*/
spin_lock(_waiter_spinlock);
bulk->userdata = NULL;
spin_unlock(_waiter_spinlock);
@@ -406,7 +409,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, 
void *data,
 
if (bulk) {
/* Cancel the signal when the transfer
-** completes. */
+* completes.
+*/
spin_lock(_waiter_spinlock);
bulk->userdata = NULL;
spin_unlock(_waiter_spinlock);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4] staging: fsl-mc: move bus driver out of staging

2017-12-20 Thread Laurentiu Tudor


On 12/20/2017 01:06 PM, Greg KH wrote:
> On Wed, Dec 20, 2017 at 10:52:52AM +, Laurentiu Tudor wrote:
>>
>>
>> On 12/20/2017 12:42 PM, Greg KH wrote:
>>> On Wed, Dec 20, 2017 at 10:26:49AM +, Laurentiu Tudor wrote:
 On 12/19/2017 06:10 PM, Greg KH wrote:
>>> But all of these .h files are only used by the code in this specific
>>> directory, no where else.
>>
>> They are also used by our ethernet driver, see:
>>   drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
>
> Ick, really?  Then they should not be buried in a bus-specific
> location, but rather be in include/linux/SOMEWHERE, right?

 Right. The goal is that in the end, all headers be moved to the already
 existing include/linux/fsl/. For now I've left these in staging because
 they are not part of the bus "core" infrastructure.
>>>
>>> Then shouldn't they be in the drivers/staging/fsl-mc/include/ directory
>>> now to show this?
>>
>> Not sure i get your comment. Aren't we talking about the headers in there?
>>
>> This was your original comment:
>>
>>   > Also, what's up with the .h files in drivers/staging/fsl-bus/include?
>>   > You didn't touch those with this movement, right?  Why?
>
> Ok, yeah, I'm getting confused now.  Let's just see what you do with
> your next set of patches and we can go from there :)

Ok, I'll start working on it. Thanks for the review!

---
Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4] staging: fsl-mc: move bus driver out of staging

2017-12-20 Thread Greg KH
On Wed, Dec 20, 2017 at 10:52:52AM +, Laurentiu Tudor wrote:
> 
> 
> On 12/20/2017 12:42 PM, Greg KH wrote:
> > On Wed, Dec 20, 2017 at 10:26:49AM +, Laurentiu Tudor wrote:
> >> On 12/19/2017 06:10 PM, Greg KH wrote:
> > But all of these .h files are only used by the code in this specific
> > directory, no where else.
> 
>  They are also used by our ethernet driver, see:
>   drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
> >>>
> >>> Ick, really?  Then they should not be buried in a bus-specific
> >>> location, but rather be in include/linux/SOMEWHERE, right?
> >>
> >> Right. The goal is that in the end, all headers be moved to the already
> >> existing include/linux/fsl/. For now I've left these in staging because
> >> they are not part of the bus "core" infrastructure.
> >
> > Then shouldn't they be in the drivers/staging/fsl-mc/include/ directory
> > now to show this?
> 
> Not sure i get your comment. Aren't we talking about the headers in there?
> 
> This was your original comment:
> 
>  > Also, what's up with the .h files in drivers/staging/fsl-bus/include?
>  > You didn't touch those with this movement, right?  Why?

Ok, yeah, I'm getting confused now.  Let's just see what you do with
your next set of patches and we can go from there :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/8] media: v4l2-async: simplify v4l2_async_subdev structure

2017-12-20 Thread Niklas Söderlund
Hi Mauro,

On 2017-12-19 09:18:19 -0200, Mauro Carvalho Chehab wrote:
> The V4L2_ASYNC_MATCH_FWNODE match criteria requires just one
> struct to be filled (struct fwnode_handle). The V4L2_ASYNC_MATCH_DEVNAME
> match criteria requires just a device name.
> 
> So, it doesn't make sense to enclose those into structs,
> as the criteria can go directly into the union.
> 
> That makes easier to document it, as we don't need to document
> weird senseless structs.
> 
> At drivers, this makes even clearer about the match criteria.
> 
> Acked-by: Sylwester Nawrocki 
> Acked-by: Benoit Parrot 
> Acked-by: Alexandre Belloni 
> Acked-by: Sakari Ailus 
> Acked-by: Philipp Zabel 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/media/platform/am437x/am437x-vpfe.c|  6 +++---
>  drivers/media/platform/atmel/atmel-isc.c   |  2 +-
>  drivers/media/platform/atmel/atmel-isi.c   |  2 +-
>  drivers/media/platform/davinci/vpif_capture.c  |  4 ++--
>  drivers/media/platform/exynos4-is/media-dev.c  |  4 ++--
>  drivers/media/platform/pxa_camera.c|  2 +-
>  drivers/media/platform/qcom/camss-8x16/camss.c |  2 +-
>  drivers/media/platform/rcar-vin/rcar-core.c|  2 +-

For rcar-vin:

Acked-by: Niklas Söderlund 

>  drivers/media/platform/rcar_drif.c |  4 ++--
>  drivers/media/platform/soc_camera/soc_camera.c |  2 +-
>  drivers/media/platform/stm32/stm32-dcmi.c  |  2 +-
>  drivers/media/platform/ti-vpe/cal.c|  2 +-
>  drivers/media/platform/xilinx/xilinx-vipp.c|  2 +-
>  drivers/media/v4l2-core/v4l2-async.c   | 16 
>  drivers/media/v4l2-core/v4l2-fwnode.c  | 10 +-
>  drivers/staging/media/imx/imx-media-dev.c  |  4 ++--
>  include/media/v4l2-async.h |  8 ++--
>  17 files changed, 35 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/media/platform/am437x/am437x-vpfe.c 
> b/drivers/media/platform/am437x/am437x-vpfe.c
> index 0997c640191d..601ae6487617 100644
> --- a/drivers/media/platform/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/am437x/am437x-vpfe.c
> @@ -2304,8 +2304,8 @@ vpfe_async_bound(struct v4l2_async_notifier *notifier,
>   vpfe_dbg(1, vpfe, "vpfe_async_bound\n");
>  
>   for (i = 0; i < ARRAY_SIZE(vpfe->cfg->asd); i++) {
> - if (vpfe->cfg->asd[i]->match.fwnode.fwnode ==
> - asd[i].match.fwnode.fwnode) {
> + if (vpfe->cfg->asd[i]->match.fwnode ==
> + asd[i].match.fwnode) {
>   sdinfo = >cfg->sub_devs[i];
>   vpfe->sd[i] = subdev;
>   vpfe->sd[i]->grp_id = sdinfo->grp_id;
> @@ -2510,7 +2510,7 @@ vpfe_get_pdata(struct platform_device *pdev)
>   }
>  
>   pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_FWNODE;
> - pdata->asd[i]->match.fwnode.fwnode = of_fwnode_handle(rem);
> + pdata->asd[i]->match.fwnode = of_fwnode_handle(rem);
>   of_node_put(rem);
>   }
>  
> diff --git a/drivers/media/platform/atmel/atmel-isc.c 
> b/drivers/media/platform/atmel/atmel-isc.c
> index 0c2635647f69..34676409ca08 100644
> --- a/drivers/media/platform/atmel/atmel-isc.c
> +++ b/drivers/media/platform/atmel/atmel-isc.c
> @@ -2088,7 +2088,7 @@ static int isc_parse_dt(struct device *dev, struct 
> isc_device *isc)
>   subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW;
>  
>   subdev_entity->asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> - subdev_entity->asd->match.fwnode.fwnode =
> + subdev_entity->asd->match.fwnode =
>   of_fwnode_handle(rem);
>   list_add_tail(_entity->list, >subdev_entities);
>   }
> diff --git a/drivers/media/platform/atmel/atmel-isi.c 
> b/drivers/media/platform/atmel/atmel-isi.c
> index e900995143a3..9958918e2449 100644
> --- a/drivers/media/platform/atmel/atmel-isi.c
> +++ b/drivers/media/platform/atmel/atmel-isi.c
> @@ -1128,7 +1128,7 @@ static int isi_graph_parse(struct atmel_isi *isi, 
> struct device_node *node)
>   /* Remote node to connect */
>   isi->entity.node = remote;
>   isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
> - isi->entity.asd.match.fwnode.fwnode = of_fwnode_handle(remote);
> + isi->entity.asd.match.fwnode = of_fwnode_handle(remote);
>   return 0;
>   }
>  }
> diff --git a/drivers/media/platform/davinci/vpif_capture.c 
> b/drivers/media/platform/davinci/vpif_capture.c
> index e45916f69def..e1c273c8b9a6 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -1390,7 +1390,7 @@ static int vpif_async_bound(struct v4l2_async_notifier 
> *notifier,
>  
>   

Re: [PATCH v4] staging: fsl-mc: move bus driver out of staging

2017-12-20 Thread Laurentiu Tudor


On 12/20/2017 12:42 PM, Greg KH wrote:
> On Wed, Dec 20, 2017 at 10:26:49AM +, Laurentiu Tudor wrote:
>> On 12/19/2017 06:10 PM, Greg KH wrote:
> But all of these .h files are only used by the code in this specific
> directory, no where else.

 They are also used by our ethernet driver, see:
  drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
>>>
>>> Ick, really?  Then they should not be buried in a bus-specific
>>> location, but rather be in include/linux/SOMEWHERE, right?
>>
>> Right. The goal is that in the end, all headers be moved to the already
>> existing include/linux/fsl/. For now I've left these in staging because
>> they are not part of the bus "core" infrastructure.
>
> Then shouldn't they be in the drivers/staging/fsl-mc/include/ directory
> now to show this?

Not sure i get your comment. Aren't we talking about the headers in there?

This was your original comment:

 > Also, what's up with the .h files in drivers/staging/fsl-bus/include?
 > You didn't touch those with this movement, right?  Why?

---
Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v1 05/10] staging: atomisp: Remove non-ACPI leftovers

2017-12-20 Thread Julia Lawall


On Wed, 20 Dec 2017, Dan Carpenter wrote:

> On Tue, Dec 19, 2017 at 10:59:52PM +0200, Andy Shevchenko wrote:
> > @@ -914,9 +904,7 @@ static int lm3554_probe(struct i2c_client *client)
> > dev_err(>dev, "gpio request/direction_output fail");
> > goto fail2;
> > }
> > -   if (ACPI_HANDLE(>dev))
> > -   err = atomisp_register_i2c_module(>sd, NULL, LED_FLASH);
> > -   return 0;
> > +   return atomisp_register_i2c_module(>sd, NULL, LED_FLASH);
> >  fail2:
> > media_entity_cleanup(>sd.entity);
> > v4l2_ctrl_handler_free(>ctrl_handler);
>
> Actually every place where we directly return a function call is wrong
> and needs error handling added.  I've been meaning to write a Smatch
> check for this because it's a common anti-pattern we don't check the
> last function call for errors.
>
> Someone could probably do the same in Coccinelle if they want.

I'm not sure what you are suggesting.  Is every case of return f(...);
for any f wrong?  Or is it a particular function that is of concern?  Or
would it be that every function call that has error handling somewhere
should have error handling everywhere?  Or is it related to what seems to
be the problem in the above code that err is initialized but nothing
happens to it?

julia
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4] staging: fsl-mc: move bus driver out of staging

2017-12-20 Thread Greg KH
On Wed, Dec 20, 2017 at 10:26:49AM +, Laurentiu Tudor wrote:
> On 12/19/2017 06:10 PM, Greg KH wrote:
> >>> But all of these .h files are only used by the code in this specific
> >>> directory, no where else.
> >>
> >> They are also used by our ethernet driver, see:
> >> drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
> >
> > Ick, really?  Then they should not be buried in a bus-specific
> > location, but rather be in include/linux/SOMEWHERE, right?
> 
> Right. The goal is that in the end, all headers be moved to the already 
> existing include/linux/fsl/. For now I've left these in staging because 
> they are not part of the bus "core" infrastructure.

Then shouldn't they be in the drivers/staging/fsl-mc/include/ directory
now to show this?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4] staging: fsl-mc: move bus driver out of staging

2017-12-20 Thread Laurentiu Tudor


On 12/19/2017 06:10 PM, Greg KH wrote:
> On Tue, Dec 19, 2017 at 03:39:44PM +, Laurentiu Tudor wrote:
>> On 12/19/2017 05:29 PM, Greg KH wrote:
>>> On Tue, Dec 19, 2017 at 03:21:19PM +, Laurentiu Tudor wrote:


 On 12/19/2017 04:48 PM, Greg KH wrote:
> On Wed, Nov 29, 2017 at 12:08:44PM +0200, laurentiu.tu...@nxp.com wrote:
>> From: Stuart Yoder 
>>
>> Move the source files out of staging into their final locations:
>>  -include files in drivers/staging/fsl-mc/include go to 
>> include/linux/fsl
>>  -irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
>>  -source in drivers/staging/fsl-mc/bus goes to drivers/bus/fsl-mc
>>  -README.txt, providing and overview of DPAA goes to
>>   Documentation/dpaa2/overview.txt
>>
>> Update or delete other remaining staging files-- Makefile, Kconfig, TODO.
>> Update dpaa2_eth and dpio staging drivers.
>>
>> Signed-off-by: Stuart Yoder 
>> Signed-off-by: Laurentiu Tudor 
>> [Laurentiu: rebased, add dpaa2_eth and dpio #include updates]
>> Cc: Thomas Gleixner 
>> Cc: Jason Cooper 
>> Cc: Marc Zyngier 
>> ---
>> Notes:
>>-v4:
>>  - regenerated patch with renames detection disabled (Andrew 
>> Lunn)
>>-v3:
>>  - rebased
>
> Ok, meta-comments on the structure of the code.
>
> You have 8 .h files that are "private" to your bus logic.  That's 7 too
> many, some of them have a bigger license header than actual content :)
>
> Please consolidate into 1.
>
> Also, the headers should be moved to SPDX format to get rid of the
> boilerplate.  I _think_ it's BSD/GPL, right?  Hard to tell :(

 It's 3-clause BSD and GPLv2. Will make it clear when moving to SPDX.
>>>
>>> Thanks.
>>>
> Your "public" .h file does not need to go into a subdirectory, just name
> it fsl-mc.h and put it in include/linux/.

 There's already a "fsl" subdirectory in include/linux/ so it seemed to
 make sense to use it.
>>>
>>> Ah, missed that.  Ok, nevermind :)`
>>>
> One comment on the fields in your .h file, all of the user/kernel
> crossing boundry structures need to use the "__" variant of types, like
> "__u8" and the like.  You mix and match them for some reason, you need
> to be consistent.
>
> Also, what's up with the .h files in drivers/staging/fsl-bus/include?
> You didn't touch those with this movement, right?  Why?

 Those are not part of the bus "core". Some of them are part of the DPBP
 and DPCON device types APIs and are used by drivers probing on this bus
 and the rest are part of the DPIO driver which is also used by other
 drivers. Since these devices (DPBP, DPCON, DPIO) are interfaces used by
 all the other drivers it made sense to group them together with the bus.
>>>
>>> But all of these .h files are only used by the code in this specific
>>> directory, no where else.
>>
>> They are also used by our ethernet driver, see:
>> drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
>
> Ick, really?  Then they should not be buried in a bus-specific
> location, but rather be in include/linux/SOMEWHERE, right?

Right. The goal is that in the end, all headers be moved to the already 
existing include/linux/fsl/. For now I've left these in staging because 
they are not part of the bus "core" infrastructure.

---
Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v1 05/10] staging: atomisp: Remove non-ACPI leftovers

2017-12-20 Thread Andy Shevchenko
On Wed, Dec 20, 2017 at 6:54 AM, Dan Carpenter  wrote:
> On Tue, Dec 19, 2017 at 10:59:52PM +0200, Andy Shevchenko wrote:
>> @@ -1147,10 +1145,8 @@ static int gc2235_probe(struct i2c_client *client)
>>   if (ret)
>>   gc2235_remove(client);
>
> This error handling is probably wrong...
>

Thanks for pointing to this, but I'm not going to fix this by the
following reasons:
1. I admit the driver's code is ugly
2. It's staging code
3. My patch does not touch those lines
4. My purpose is to get it working first.

Feel free to send a followup with a good clean up which I agree with.

>>
>> - if (ACPI_HANDLE(>dev))
>> - ret = atomisp_register_i2c_module(>sd, gcpdev, 
>> RAW_CAMERA);
>> + return atomisp_register_i2c_module(>sd, gcpdev, RAW_CAMERA);
>
> In the end this should look something like:
>
> ret = atomisp_register_i2c_module(>sd, gcpdev, RAW_CAMERA);
> if (ret)
> goto err_free_something;
>
> return 0;
>
>>
>> - return ret;
>>  out_free:
>>   v4l2_device_unregister_subdev(>sd);
>>   kfree(dev);
>
> regards,
> dan carpenter
>



-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [-next PATCH 0/4] sysfs and DEVICE_ATTR_

2017-12-20 Thread Felipe Balbi

Hi,

Joe Perches  writes:
>  drivers/usb/phy/phy-tahvo.c|  2 +-

Acked-by: Felipe Balbi 

-- 
balbi
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v1 05/10] staging: atomisp: Remove non-ACPI leftovers

2017-12-20 Thread Dan Carpenter
On Tue, Dec 19, 2017 at 10:59:52PM +0200, Andy Shevchenko wrote:
> @@ -914,9 +904,7 @@ static int lm3554_probe(struct i2c_client *client)
>   dev_err(>dev, "gpio request/direction_output fail");
>   goto fail2;
>   }
> - if (ACPI_HANDLE(>dev))
> - err = atomisp_register_i2c_module(>sd, NULL, LED_FLASH);
> - return 0;
> + return atomisp_register_i2c_module(>sd, NULL, LED_FLASH);
>  fail2:
>   media_entity_cleanup(>sd.entity);
>   v4l2_ctrl_handler_free(>ctrl_handler);

Actually every place where we directly return a function call is wrong
and needs error handling added.  I've been meaning to write a Smatch
check for this because it's a common anti-pattern we don't check the
last function call for errors.

Someone could probably do the same in Coccinelle if they want.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel