summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208/sd.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: rts5208: simplify NULL testsEva Rachel Retuya2016-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Use min instead of ternary operatorBhumika Goyal2016-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min returns the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Place constants on the right side of comparisonsJanani Ravichandran2016-02-141-10/+10
| | | | | | | | Constants should be placed on the right hand side of comparisons. This issue was identified by checkpatch. Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Fix code indentation warning as detected by checkpatch.plYash Shah2015-08-031-6/+4
| | | | | | | Fixed code indentation warning as detected by checkpatch.pl. Signed-off-by: Yash Shah <yshah1@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Fix checkpatch warning: else is not generally usefulLeung Timothy Chi King2015-07-141-6/+5
| | | | | | | | | The following checkpatch warning was fixed: WARNING: else is not generally useful after a break or return Signed-off-by: Leung Timothy Chi King <contact@timothyleung.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macrosJoe Perches2015-03-261-92/+402
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macros with hidden flow control are bad form as the code path taken can be unexpected for the reader. Expand these in-place and remove the macros. Done with coccinelle script: @@ expression chip; expression arg1; expression arg2; expression arg3; @@ - RTSX_WRITE_REG(chip, arg1, arg2, arg3); + retval = rtsx_write_register(chip, arg1, arg2, arg3); + if (retval) { + rtsx_trace(chip); + return retval; + } @@ expression chip; expression arg1; expression arg2; @@ - RTSX_READ_REG(chip, arg1, arg2); + retval = rtsx_read_register(chip, arg1, arg2); + if (retval) { + rtsx_trace(chip); + return retval; + } Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove TRACE_RET and TRACE_GOTO macrosJoe Perches2015-03-261-465/+924
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove these flow hiding macros. Miscellanea: o Add a macro and function to replace a large inline o Simplify #includes o Add trace.c and update Makefile o Remove static inline filename function and use kbasename instead This reduces object size quite a lot: ~350KB (x86-64 allyesconfig) $ size drivers/staging/rts5208/built-in.o* text data bss dec hex filename 248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new 506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old Done via coccinelle script and some typing. @@ expression chip; expression ret; @@ - TRACE_RET(chip, ret); + rtsx_trace(chip); + return ret; @@ expression chip; identifier label; @@ - TRACE_GOTO(chip, label); + rtsx_trace(chip); + goto label; Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Convert variable from int to bool and propagate the change ↵Quentin Lambert2015-03-061-23/+21
| | | | | | | | | | | | | to function parameters This patch convert local variables declared as int into booleans. It also propagates the conversion when these variables were used as function parameters. Coccinelle was used to generate this patch. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Convert non-returned local variable to boolean when relevantQuentin Lambert2015-03-061-42/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was produced using Coccinelle. A simplified version of the semantic patch is: @r exists@ identifier f; local idexpression u8 x; identifier xname; @@ f(...) { ...when any ( x@xname = 1; | x@xname = 0; ) ...when any } @bad exists@ identifier r.f; local idexpression u8 r.x expression e1 != {0, 1}, e2; @@ f(...) { ...when any ( x = e1; | x + e2 ) ...when any } @depends on !bad@ identifier r.f; local idexpression u8 r.x; identifier r.xname; @@ f(...) { ... ++ bool xname; - int xname; <... ( x = - 1 + true | x = - -1 + false ) ...> } Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Fix checkpatch warning: Missing blank lineTina Johnson2014-09-231-0/+6
| | | | | | | | | The following checkpatch warning was fixed : WARNING: Missing a blank line after declarations Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Remove CONFIG_RTS5208_DEBUG optionFabio Falzoi2014-08-161-4/+1
| | | | | | | | CONFIG_RTS5208_DEBUG is no more needed, we rely on dynamic debug config options instead. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Use dev_dbg and print_hex_dump_bytes to dump memoryFabio Falzoi2014-08-161-3/+3
| | | | | | | | Use dev_dbg with %*ph format specifier and print_hex_dump_bytes to dump memory instead of relying on custom macro. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Replace custom macro with dev_dbgFabio Falzoi2014-07-301-84/+101
| | | | | | | Use dev_dbg macro to control tracing verbosity through dynamic debug facility. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: add support for rts5208 and rts5288Micky Ching2013-11-251-0/+4525
There are still many rts5208/5288 card readers being used, but no drivers are supported them in kernel now. This driver can make a great convenience for people who use them. Many other rts-series card reader are supported by mfd driver, but due to much difference with others, rts5208/5288 can not add into mfd driver pretty now, so we provide a separated driver here to support the device. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud