aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000/kpc2000_spi.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-04staging: kpc2000: simplify comparison to NULL in kpc2000_spi.cSimon Sandström1-2/+2
Fixes checkpatch warning "Comparison to NULL could be written [...]". Signed-off-by: Simon Sandström <simon@nikanor.nu> Link: https://lore.kernel.org/r/20190704060811.10330-2-simon@nikanor.nu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-03staging: kpc2000: fix brace issues in kpc2000_spi.cSimon Sandström1-21/+12
Fixes issues found by checkpatch: - "WARNING: braces {} are not necessary for single statement blocks" - "WARNING: braces {} are not necessary for any arm of this statement" Signed-off-by: Simon Sandström <simon@nikanor.nu> Link: https://lore.kernel.org/r/20190701091819.18528-1-simon@nikanor.nu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: remove needless 'break'Fabian Krueger1-1/+0
The unconditioned jump will prohibit to ever reach the break-statement. Deleting this needless statement, the code becomes more understandable. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: introduce __func__Fabian Krueger1-3/+5
Instead of using the function name hard coded as string, using __func__ and the '%s'-placeholder will always give the current name of the function. When renaming a function, the debugging-messages won't have to be rewritten. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: introduce 'unsigned int'Fabian Krueger1-2/+2
Replaced 'unsigned' with it's equivalent 'unsigned int' to reduce confusion while reading the code. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: introduce usage of __packedFabian Krueger1-3/+3
Replaced __attribute__((packed)) with __packed. Both ways of attributing are equivalent, but being shorter, __packed should be preferred. This refactoring makes the core more readable. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: blank lines after declarationFabian Krueger1-0/+4
After the declarations in a function, there should be a blank line, so that the declaration part is visibly separated from the rest. This refactoring makes the code more readable. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: kpc2000: add line breaksFabian Krueger1-12/+22
To fix some checkpatch-warnings some lines of this module had to be shortened so that they do not exceed 80 characters per line. This refactoring makes the code more readable. Signed-off-by: Fabian Krueger <fabian.krueger@fau.de> Signed-off-by: Michael Scheiderer <michael.scheiderer@fau.de> Cc: <linux-kernel@i4.cs.fau.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26staging: kpc2000: add missing spaces in kpc2000_spi.cSimon Sandström1-7/+7
Fixes checkpatch errors: - spaces required around that '=' (ctx:VxV) - space required before the open parenthesis '(' - spaces preferred around that '-' (ctx:VxV) - space required before the open brace '{' Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-10staging: kpc2000: remove extra white space in kpc2000_spi.cNaoto Kobayashi1-1/+1
Since whitespace should not appear between asterisk and variable name in a declaration statement, remove it and fix checkpatch.pl error "foo * bar" should be "foo *bar". Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary cast in [read|write]_reg()Geordan Neukum1-2/+2
The kpc_spi driver unnecessarily casts from a (u64 __iomem *) to a (void *) when invoking readq and writeq which both take a (void __iomem *) arg. There is no need for this cast, and it actually harms us by discarding the sparse cookie, __iomem. Make the driver stop performing this casting operation. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary ulong repr of i/o addrGeordan Neukum1-4/+2
The kpc_spi driver stashes off an unsigned long representation of the i/o mapping returned by devm_ioremap_nocache(). This is unnecessary, as the only use of the unsigned long repr is to eventually be re-cast to an (u64 __iomem *). Instead of casting the (void __iomem *) to an (unsigned long) then a (u64 __iomem *), just remove this intermediate step. As this intermediary is no longer used, also remove it from its structure. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary struct member chip_selectGeordan Neukum1-2/+0
The structure kp_spi_controller_state, defined in the kpc2000_spi driver, contains a member named chip_select which is never used after initialization. Therefore, it should be removed for simplicity's sake. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary struct member word_lenGeordan Neukum1-3/+0
The structure kp_spi_controller_state, defined in the kpc2000_spi driver, contains a member named word_len which is never used after initialization. Therefore, it should be removed for simplicity's sake. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary struct member pin_dirGeordan Neukum1-2/+0
The structure kpc_spi, defined in in the kpc2000_spi driver, contains a member named pin_dir which is never used after initialization. Therefore, it should be removed for simplicity's sake. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06staging: kpc2000: kpc_spi: remove unnecessary struct member physGeordan Neukum1-2/+0
The structure kp_spi_controller_state, defined in the kpc2000_spi driver, contains a member named phys which is never used after initialization. Therefore, it should be removed for simplicity's sake. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O spaceGeordan Neukum1-1/+2
The kpc_spi driver does not unmap its I/O space upon error cases in the probe() function or upon remove(). Make the driver clean up after itself more maintainably by migrating to using the managed resource API. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03staging: kpc2000: kpc_spi: remove function kp_spi_bytes_per_word()Geordan Neukum1-14/+0
The static function kp_spi_bytes_per_word() is defined in kpc2000_spi.c, but it is completely unused. As this function is unused, it can and should be removed. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03staging: kpc2000: kpc_spi: remove fifo_depth from kp_spi structGeordan Neukum1-1/+0
The kp_spi structure contains a member 'fifo_depth'. This member is never used. Therefore, it should be removed. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03staging: kpc2000: kpc_spi: column-align switch and subordinate casesGeordan Neukum1-7/+7
The linux style guide prescribes that switch statements and their subordinate case labels should be column-aligned rather than double-indenting the case label. Make kpc2000_spi.c follow the desired style with respect to switch/case alignment. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03staging: kpc2000: kpc_spi: Remove unnecessary consecutive newlinesGeordan Neukum1-13/+0
The kpc2000_spi.c file contains instances of unnecessary consecutive newlines which negatively impact the readability of the file. Remove all unnecessary consecutive newlines. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30staging: kpc2000: replace white spaces with tabs for kpc2000_spi.cMao Wenan1-361/+361
There are multiple wrong formats in kpc2000_spi.c, is time to do clean work for it. Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30staging: kpc2000: report error status to spi coreMao Wenan1-2/+6
There is an error condition that's not reported to the spi core in kp_spi_transfer_one_message(). It should restore status value to m->status, and return it in error path. Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21staging: kpc2000: move the spi driver out of its subdirectoryGreg Kroah-Hartman1-0/+548
There is no need for a subdirectory for just a single .c file. So move it out of kpc_spi/ and rename it to the module name that we want the file to build to, saving one more linking stage. Cc: Matt Sickler <Matt.Sickler@daktronics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>