aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/emxx_udc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-25staging: emxx_udc: fix alignment issuesHarold Mertzweiller1-7/+4
Three function calls can now be properly formatted inside the 100 characters limit. Signed-off-by: Harold Mertzweiller <harold@mrtz.fr> Link: https://lore.kernel.org/r/20210524152128.20519-1-harold@mrtz.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-20staging: emxx_udc: fix loop in _nbu2ss_nuke()Dan Carpenter1-2/+2
The _nbu2ss_ep_done() function calls: list_del_init(&req->queue); which means that the loop will never exit. Fixes: ca3d253eb967 ("Staging: emxx_udc: Iterate list using list_for_each_entry") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YKUd0sDyjm/lkJfJ@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10staging: emxx_udc: remove unused variable driver_descSean Behan1-1/+0
When building with W=1 (or however you found it), there is a warning that this variable is unused. It is not used so remove it to fix the warning. Signed-off-by: Sean Behan <codebam@riseup.net> Link: https://lore.kernel.org/r/20210217142118.7107-1-codebam@riseup.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-07staging: emxx_udc: Make incorrectly defined global staticKumar Kartikeya Dwivedi2-2/+3
The global gpio_desc pointer and int vbus_irq were defined in the header, instead put the definitions in the translation unit and make them static as there's only a single consumer, and these symbols shouldn't pollute the global namespace. This fixes the following sparse warnings for this driver: drivers/staging/emxx_udc/emxx_udc.c: note: in included file: drivers/staging/emxx_udc/emxx_udc.h:23:18: warning: symbol 'vbus_gpio' was not declared. Should it be static? drivers/staging/emxx_udc/emxx_udc.h:24:5: warning: symbol 'vbus_irq' was not declared. Should it be static? Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20210207085911.270746-1-memxor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-22staging/emxx_udc: fix indenting issue on a couple of statementsColin Ian King1-3/+3
A couple of statements are indented too deeply, remove the extraneous tabs. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200918214731.48750-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-13staging: emxx_udc: Remove misplaced debugging aidMikhail Gusarov1-5/+0
emxx_udc.h contained a #if 0 block with debugging macros. These should be supplied via command line or Kconfig. Fixes checkstyle's WARNING: Consider removing the code enclosed by this #if 0 and its #endif Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Link: https://lore.kernel.org/r/20200911213350.15914-1-dottedmag@dottedmag.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-02staging/emxx_udc: Remove pointless variable assignmentsAlex Dewar1-5/+4
In a number of places in emxx_udc.c, there are variables which are assigned to without that value ever being used. Remove these pointless assignments. Reported-by: kernel test robot <lkp@intel.com> Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Link: https://lore.kernel.org/r/20200902154628.283453-1-alex.dewar90@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-28staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()Alex Dewar1-2/+2
In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(), though, strangely, NULL is passed as the struct device* argument. Pass the UDC's device instead. Fix up the corresponding call to dma_free_coherent() in the same way. Build-tested on x86 only. Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Link: https://lore.kernel.org/r/20200825091928.55794-1-alex.dewar90@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18staging: emxx_udc: Allow for building on !ARMAlex Dewar1-1/+1
Currently the module can only be test built on ARM, although it seems to build fine on x86. Change this to allow for broader test coverage. Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Link: https://lore.kernel.org/r/20200818151133.583382-1-alex.dewar90@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18staging: emxx_udc: Use standard BIT() macroAlex Dewar1-245/+211
Currently emxx_udc.h defines bit values using local macros. Use the standard one instead. Also, combine bit values with bitwise-or rather than addition, as suggested by Coccinelle. Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Link: https://lore.kernel.org/r/20200818134922.409195-1-alex.dewar90@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-30staging: emxx_udc: Fix invalid reference errorJavier F. Arias1-10/+8
This patch fixes an invalid reference error by moving the code that is executed when a queue element is found, into the loop. Also, it removes an unnecessary test that now checks if the element is not present in the queue. Issue found by Coccinelle. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/20191030030419.mmnrzm7hr4encfai@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-29staging: emxx_udc: Fix the format of a parameter listFrank A. Cancio Bello1-3/+2
The closing parenthesis of a multiline parameter list looks better in the same line as the last parameter. The comma that separates parameters should be at the end of the line. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Link: https://lore.kernel.org/r/20191028165906.tv5zxjiqwjthygnq@linux-kernel-dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-10staging: emxx_udc: use devm_platform_ioremap_resource() to simplify codeYueHaibing1-3/+1
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20191009150535.6412-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12staging: emxx_udc: remove local TRUE/FALSE definitionSaiyam Doshi2-43/+38
As the function argument and variables are defined as type 'bool', remove local TRUE/FALSE define and change usage of those macros with boolean value. Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com> Link: https://lore.kernel.org/r/20190908175247.GA20699@SD Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30staging: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-43-swboyd@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02staging: emxx_udc: emxx_udc.c: Replace bit shifting with BIT macroPayal Kshirsagar1-3/+3
Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-27staging: emxx_udc: remove unneeded parenthesisEmiliano Ingrassia1-5/+5
Fix 5 warnings detected by checkpatch.pl about unneeded parenthesis around conditions tests. Signed-off-by: Emiliano Ingrassia <ingrassia.emiliano@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21staging: emxx_udc: lines should not end with parenthesisPayal Kshirsagar1-17/+17
Adjust code to meet the style of “lines should not end with parenthesis”. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: emxx_udc: Fix open parenthesis at the end of the lineDaniela Mormocea1-2/+1
warning detected by checkpatch.pl Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: emxx_udc: Fix equal sign alignmentDaniela Mormocea1-2/+2
Warning detected by checkpatch Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15Staging: emxx_udc: Switch to the gpio descriptor interfaceNishad Kamdar2-15/+18
Convert VBUS GPIO to use GPIO descriptors from <linux/gpio/consumer.h> and stop using the old GPIO API. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05staging: emxx_udc: Remove cast and move all in one line.Cristian Sicilia1-8/+4
Remove the cast from IO_ADDRESS and use a single line. Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-20staging: emxx_udc: Fixing function namingCristian Sicilia1-142/+70
Fix function naming and parenthesis. Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08staging: emxx_udc: Added missing le16_to_cpu conversionsCarmeli Tamir1-10/+12
Fixed sparse tool warnings due to missing convesion from le16 to cpu endienness. Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08staging: emxx_udc: Added missing __iomem modifier to handle p_regsCarmeli Tamir2-23/+23
Since in nbu2ss_drv_probe() p_regs is assigned from mmio_base, which is marked as __iomem, p_regs also should be market with __iomem. Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08staging: emxx_udc: Added static modifier to udc_controllerCarmeli Tamir1-1/+1
Added static modifier to the udc_controller, since it's only required within emxx_udc.c. Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: emxx_udc: Remove unused device_desc declarationNathan Chancellor1-19/+0
Clang warns: drivers/staging/emxx_udc/emxx_udc.c:1373:37: warning: variable 'device_desc' is not needed and will not be emitted [-Wunneeded-internal-declaration] static struct usb_device_descriptor device_desc = { ^ 1 warning generated. This definition hasn't been attached to anything since the driver was introduced in commit 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") and neither GCC nor Clang emit any reference to the variable in the final assembly. The only reason GCC doesn't warn about this variable being unused is the sizeof function. Reported-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: emxx_udc: remove unnecessary nullpointer checksArkadiusz Lis1-22/+2
This patch removes nullpointer checks which are redundant. container_of returns structure containing entity which we know for sure is not null, so the whole structure can not be null. Signed-off-by: Arkadiusz Lis <areklis909@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: emxx_udc: Add GPIO descriptor work to TODOLinus Walleij1-0/+2
To make sure this driver does not leave staging without a proper conversion to the GPIO descriptor API, leave a note in the TODO. Cc: Magnus Damm <damm+renesas@opensource.se> Cc: Simon Horman <horms+renesas@verge.net.au> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: emxx_udc: Change platform dependency to ARCH_RENESASGeert Uytterhoeven1-1/+1
Emma Mobile is a Renesas ARM SoC. Since commit 9b5ba0df4ea4f940 ("ARM: shmobile: Introduce ARCH_RENESAS") is ARCH_RENESAS a more appropriate platform dependency than the legacy ARCH_SHMOBILE, hence use the former. This will allow to drop ARCH_SHMOBILE on ARM in the near future. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: emxx_udc: Remove unnecessary NULL checksDan Carpenter1-8/+0
These pointers can't be NULL so I have removed the checks. The checking was sort of problematic as well because it didn't make sense. In _nbu2ss_read_request_data() the && should have been ||. In nbu2ss_gad_get_frame() we know that "pgadget" is non-NULL and "udc" is an offset from "pgadget" so it can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: emxx_udc: Remove unneeded castChristopher Diaz Riveros1-1/+1
Fix Coccinelle alert: drivers/staging//emxx_udc/emxx_udc.c:2689:19-21: WARNING: casting value returned by memory allocation function to (u8 *) is useless. This issue was detected by using the Coccinelle software. Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: emxx_udc: remove redundant license textGreg Kroah-Hartman2-18/+0
Now that the SPDX tag is in the emxx_udc driver files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: emxx_udc: add SPDX identifier.Greg Kroah-Hartman2-0/+2
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the staging emxx_udc driver to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Update "reserved" registers nameAlexis Lothoré1-5/+5
Ensure that "Reserved" members of registers mapping structure do not mix upper/lower case Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Break long linesAlexis Lothoré1-3/+8
Make sure to break long lines to 80 Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Update function parameters nameAlexis Lothoré1-6/+6
Ensure that function parameters use snake_case (some mixed upper/lower case) Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Update local variable namesAlexis Lothoré1-124/+124
Ensure that any any local variable use snake_case (many mixed upper/lower case) Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Update function namesAlexis Lothoré1-4/+4
Ensure that function names does not mix upper/lower case Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Balance "else" parenthesisAlexis Lothoré1-1/+2
Add missing parenthesis for else statement Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: emxx_udc: Update EPn variables nameAlexis Lothoré2-176/+176
Update EPn* variables names to EPN* to prevent CamelCase usage Signed-off-by: Alexis Lothoré <alexis.lothore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: emxx_udc: Add comment for spinlock_t definition.Varsha Rao1-1/+1
Members of nbu2ss_udc structure can change device state, maintain completion state and control driver. Also provide access to read and write to register. Hence, exclusive access to nbu2ss_udc is required. The lock variable of type spinlock_t guarantees the exclusive access and protects it. In this patch, comment is added for spinlock_t definition, to fix the following checkpatch issue: CHECK: spinlock_t definition without comment Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: emxx_udc: Fix CamelCase variable nameAfonso Bordado1-4/+4
Changes from CamelCase to a kernel format Signed-off-by: Afonso Bordado <afonsobordado@az8.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: emxx_udc: Remove unecessary temporary variableAfonso Bordado1-9/+7
This improves code readability. Signed-off-by: Afonso Bordado <afonsobordado@az8.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: emxx_udc: Rename CamelCase variableAfonso Bordado1-8/+4
The new name complies with the kernel styling guidelines and is more descriptive. Signed-off-by: Afonso Bordado <afonsobordado@az8.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: emxx_udc: Fix CamelCase function nameAfonso Bordado1-2/+2
Change EP0_out_PIO to use the kernel convention. Signed-off-by: Afonso Bordado <afonsobordado@az8.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: emxx_udc: remove incorrect __init annotationsArnd Bergmann1-2/+2
The probe function is not marked __init, but some other functions are. This leads to a warning on older compilers (e.g. gcc-4.3), and can cause executing freed memory when built with those compilers: WARNING: drivers/staging/emxx_udc/emxx_udc.o(.text+0x2d78): Section mismatch in reference from the function nbu2ss_drv_probe() to the function .init.text:nbu2ss_drv_contest_init() This removes the annotations. Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: emxx_udc: emxx_udc.c Align parenthesisWalt Feasel1-2/+2
Make suggested checkpatch modification for CHECK: Alignment should match open parenthesis Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>