From c4d63980f305f5543fa2e26991db5697dea19327 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 19 Apr 2018 10:41:15 +0200 Subject: staging: greybus: Add TODO file with GPIO work items To make sure that these drivers do not leave staging before they are properly converted to use the new GPIO descriptor API, and the GPIOLIB_IRQCHIP helper library, create the TODO file with these work items. Cc: Johan Hovold Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/TODO | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 drivers/staging/greybus/TODO (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/TODO b/drivers/staging/greybus/TODO new file mode 100644 index 000000000000..3b90a5711998 --- /dev/null +++ b/drivers/staging/greybus/TODO @@ -0,0 +1,5 @@ +* Convert all uses of the old GPIO API from to the + GPIO descriptor API in and look up GPIO + lines from device tree or ACPI. +* Convert the GPIO driver to use the GPIO irqchip library + GPIOLIB_IRQCHIP instead of reimplementing the same. -- cgit v1.2.3 From dc9dc74986cf4900d393c7185121f82c66418ee1 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Fri, 6 Apr 2018 16:39:22 +0530 Subject: staging: greybus: Fix warning to limit chars per line Wrap comment to fix warning "prefer a maximum 75 chars per line" Signed-off-by: Gaurav Dhingra Acked-by: Vaibhav Agarwal Reviewed-by: Mark Greer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_codec.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index a1d5440552d4..4efd8b3ebe07 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -23,7 +23,10 @@ enum { NUM_CODEC_DAIS, }; -/* device_type should be same as defined in audio.h (Android media layer) */ +/* + * device_type should be same as defined in audio.h + * (Android media layer) + */ enum { GBAUDIO_DEVICE_NONE = 0x0, /* reserved bits */ -- cgit v1.2.3 From 1dab154ef1a44933a07c0968ecd34b194ff260eb Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 19 Apr 2018 16:06:17 +0200 Subject: staging: greybus: simplify getting .drvdata We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Acked-by: Viresh Kumar Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/arche-platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 83254a72a7bb..8fe8b6e35432 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -315,8 +315,7 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct platform_device *pdev = to_platform_device(dev); - struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev); + struct arche_platform_drvdata *arche_pdata = dev_get_drvdata(dev); int ret = 0; mutex_lock(&arche_pdata->platform_state_mutex); -- cgit v1.2.3 From a2e63709b53312002009c564460af34520c62f98 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Sat, 28 Apr 2018 10:05:39 +0530 Subject: staging: greybus: Use gpio_is_valid() Replace the manual validity checks for the GPIO with the gpio_is_valid(). Signed-off-by: Arvind Yadav Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/arche-platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 8fe8b6e35432..4c36e88766e7 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -447,7 +447,7 @@ static int arche_platform_probe(struct platform_device *pdev) arche_pdata->svc_reset_gpio = of_get_named_gpio(np, "svc,reset-gpio", 0); - if (arche_pdata->svc_reset_gpio < 0) { + if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) { dev_err(dev, "failed to get reset-gpio\n"); return arche_pdata->svc_reset_gpio; } @@ -467,7 +467,7 @@ static int arche_platform_probe(struct platform_device *pdev) arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np, "svc,sysboot-gpio", 0); - if (arche_pdata->svc_sysboot_gpio < 0) { + if (!gpio_is_valid(arche_pdata->svc_sysboot_gpio)) { dev_err(dev, "failed to get sysboot gpio\n"); return arche_pdata->svc_sysboot_gpio; } @@ -486,7 +486,7 @@ static int arche_platform_probe(struct platform_device *pdev) arche_pdata->svc_refclk_req = of_get_named_gpio(np, "svc,refclk-req-gpio", 0); - if (arche_pdata->svc_refclk_req < 0) { + if (!gpio_is_valid(arche_pdata->svc_refclk_req)) { dev_err(dev, "failed to get svc clock-req gpio\n"); return arche_pdata->svc_refclk_req; } -- cgit v1.2.3 From 25a7be4eb72fec180829c7dd6076abd3fca39dab Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sat, 5 May 2018 23:50:44 -0700 Subject: staging: greybus: Remove unused local variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 warning: variable ‘intf_id’ set but not used [-Wunused-but-set-variable] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/svc.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index a874fed761a1..a2bb7e1a3db3 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -1137,7 +1137,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op) struct gb_svc *svc = gb_connection_get_data(op->connection); struct gb_message *request = op->request; struct gb_svc_intf_reset_request *reset; - u8 intf_id; if (request->payload_size < sizeof(*reset)) { dev_warn(&svc->dev, "short reset request received (%zu < %zu)\n", @@ -1146,8 +1145,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op) } reset = request->payload; - intf_id = reset->intf_id; - /* FIXME Reset the interface here */ return 0; -- cgit v1.2.3 From ac5d6d869c053e0b9c6d375742fc0135358297aa Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 22 May 2018 09:33:42 +0100 Subject: staging: greybus: fix spelling mistake: "Inavlid" -> "Invalid" Trivial fix to spelling mistake in dev_err error message Signed-off-by: Colin Ian King Acked-by: Vaibhav Agarwal Acked-by: Mark Greer Acked-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index de4b1b2b12f3..15e57f701630 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -996,7 +996,7 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, ret = gbaudio_validate_kcontrol_count(w); if (ret) { - dev_err(module->dev, "Inavlid kcontrol count=%d for %s\n", + dev_err(module->dev, "Invalid kcontrol count=%d for %s\n", w->ncontrols, w->name); return ret; } -- cgit v1.2.3 From 00aaa6b138d967cd815f427c59c4e4162084e574 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 29 May 2018 16:29:35 +0200 Subject: staging: greybus: camera: no need to check debugfs return values When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Clean up the greybus camera driver by not caring about the value of debugfs calls. This ends up removing a number of lines of code that are not needed. Cc: Alex Elder Cc: Greg Kroah-Hartman Cc: greybus-dev@lists.linaro.org Reviewed-by: Viresh Kumar Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/camera.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'drivers/staging/greybus') diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 07ebfb88db9b..341f729a9779 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -1174,11 +1174,6 @@ static int gb_camera_debugfs_init(struct gb_camera *gcam) gcam->bundle->id); gcam->debugfs.root = debugfs_create_dir(dirname, gb_debugfs_get()); - if (IS_ERR(gcam->debugfs.root)) { - gcam_err(gcam, "debugfs root create failed (%ld)\n", - PTR_ERR(gcam->debugfs.root)); - return PTR_ERR(gcam->debugfs.root); - } gcam->debugfs.buffers = vmalloc(sizeof(*gcam->debugfs.buffers) * GB_CAMERA_DEBUGFS_BUFFER_MAX); @@ -1188,18 +1183,12 @@ static int gb_camera_debugfs_init(struct gb_camera *gcam) for (i = 0; i < ARRAY_SIZE(gb_camera_debugfs_entries); ++i) { const struct gb_camera_debugfs_entry *entry = &gb_camera_debugfs_entries[i]; - struct dentry *dentry; gcam->debugfs.buffers[i].length = 0; - dentry = debugfs_create_file(entry->name, entry->mask, - gcam->debugfs.root, gcam, - &gb_camera_debugfs_ops); - if (IS_ERR(dentry)) { - gcam_err(gcam, - "debugfs operation %s create failed (%ld)\n", - entry->name, PTR_ERR(dentry)); - return PTR_ERR(dentry); + debugfs_create_file(entry->name, entry->mask, + gcam->debugfs.root, gcam, + &gb_camera_debugfs_ops); } } -- cgit v1.2.3