summaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000/kpc2000_spi.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: drop kpc2000 driverGreg Kroah-Hartman2021-06-121-517/+0
| | | | | | | | | | | | | | It seems that the old developer is no longer with the company producing this device, and the company has no plans on getting this out of the staging directory at all, so let's drop the driver for now as it's pretty much abandonded. If someone want to support this and get it out of staging, we can easily revert this change and bring it back. Cc: Matt Sickler <matt.sickler@msk4.com> Link: https://lore.kernel.org/r/20210610183153.2397760-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: code style: match alignment with open parenthesisNikolay Kyx2021-03-101-1/+1
| | | | | | | | | | | | This patch fixes the following checkpatch.pl check: CHECK: Alignment should match open parenthesis in files kpc2000_i2c.c kpc2000_spi.c Signed-off-by: Nikolay Kyx <knv418@gmail.com> Link: https://lore.kernel.org/r/20210221132246.1154-1-knv418@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: kpc2000_spi: Use new structure for SPI transfer delaysSergiu Cuciurean2020-03-101-2/+2
| | | | | | | | | | | | | | | | In a recent change to the SPI subsystem in commit <bebcfd272df6> ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()"), a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Link: https://lore.kernel.org/r/20200304073746.19664-1-sergiu.cuciurean@analog.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* remove ioremap_nocache and devm_ioremap_nocacheChristoph Hellwig2020-01-061-1/+1
| | | | | | | | ioremap has provided non-cached semantics by default since the Linux 2.6 days, so remove the additional ioremap_nocache interface. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
* staging: KPC2000: kpc2000_spi.c: Fix style issues (Unnecessary parenthesis)Chandra Annamaneni2019-10-301-1/+1
| | | | | | | | Resolved: CHECK: Unnecessary parentheses around table[i] Signed-off-by: Chandra Annamaneni <chandra627@gmail.com> Link: https://lore.kernel.org/r/20191029091638.16101-4-chandra627@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: KPC2000: kpc2000_spi.c: Fix style issues (alignment)Chandra Annamaneni2019-10-301-7/+7
| | | | | | | | Resolved: "CHECK: Alignment should match open parenthesis" from checkpatch Signed-off-by: Chandra Annamaneni <chandra627@gmail.com> Link: https://lore.kernel.org/r/20191029091638.16101-3-chandra627@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: KPC2000: kpc2000_spi.c: Fix style issues (misaligned brace)Chandra Annamaneni2019-10-301-2/+1
| | | | | | | | Resolved: ERROR: else should follow close brace '}' Signed-off-by: Chandra Annamaneni <chandra627@gmail.com> Link: https://lore.kernel.org/r/20191029091638.16101-2-chandra627@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: KPC2000: kpc2000_spi.c: Fix style issues (missing blank line)Chandra Annamaneni2019-10-301-0/+1
| | | | | | | | Resolved: "CHECK: Please use a blank line after.." from checkpatch.pl Signed-off-by: Chandra Annamaneni <chandra627@gmail.com> Link: https://lore.kernel.org/r/20191029091638.16101-1-chandra627@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: Remove unnecessary return variableWambui Karuga2019-10-101-3/+1
| | | | | | | | | | | | | | | | | | | | | Remove unnecessary variable `val` in kp_spi_read_reg() that only holds the return value from readq(). Issue found by coccinelle using the script: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Link: https://lore.kernel.org/r/20191009170703.GA2869@wambui Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: kpc_spi: Remove unnecessary null check before kfreeYueHaibing2019-07-221-2/+1
| | | | | | | | | A null check before a kfree is redundant, so remove it. This is detected by coccinelle. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190711140726.46732-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: simplify comparison to NULL in kpc2000_spi.cSimon Sandström2019-07-041-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>
* staging: kpc2000: fix brace issues in kpc2000_spi.cSimon Sandström2019-07-031-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>
* staging: kpc2000: remove needless 'break'Fabian Krueger2019-07-011-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>
* staging: kpc2000: introduce __func__Fabian Krueger2019-07-011-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>
* staging: kpc2000: introduce 'unsigned int'Fabian Krueger2019-07-011-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>
* staging: kpc2000: introduce usage of __packedFabian Krueger2019-07-011-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>
* staging: kpc2000: blank lines after declarationFabian Krueger2019-07-011-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>
* staging: kpc2000: add line breaksFabian Krueger2019-07-011-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>
* staging: kpc2000: add missing spaces in kpc2000_spi.cSimon Sandström2019-06-261-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>
* staging: kpc2000: remove extra white space in kpc2000_spi.cNaoto Kobayashi2019-06-101-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>
* staging: kpc2000: kpc_spi: remove unnecessary cast in [read|write]_reg()Geordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: remove unnecessary ulong repr of i/o addrGeordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: remove unnecessary struct member chip_selectGeordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: remove unnecessary struct member word_lenGeordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: remove unnecessary struct member pin_dirGeordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: remove unnecessary struct member physGeordan Neukum2019-06-061-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>
* staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O spaceGeordan Neukum2019-06-031-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>
* staging: kpc2000: kpc_spi: remove function kp_spi_bytes_per_word()Geordan Neukum2019-06-031-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>
* staging: kpc2000: kpc_spi: remove fifo_depth from kp_spi structGeordan Neukum2019-06-031-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>
* staging: kpc2000: kpc_spi: column-align switch and subordinate casesGeordan Neukum2019-06-031-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>
* staging: kpc2000: kpc_spi: Remove unnecessary consecutive newlinesGeordan Neukum2019-06-031-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>
* staging: kpc2000: replace white spaces with tabs for kpc2000_spi.cMao Wenan2019-05-301-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>
* staging: kpc2000: report error status to spi coreMao Wenan2019-05-301-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>
* staging: kpc2000: move the spi driver out of its subdirectoryGreg Kroah-Hartman2019-05-211-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>