Re: [PATCH v2] staging: kpc2000: kpc_i2c: remove the macros inb_p and outb_p

2019-06-10 Thread Geordan Neukum
On Mon, Jun 10, 2019 at 03:48:24PM +0800, Hao Xu wrote: > remove inb_p and outb_p to call readq/writeq directly. > > Signed-off-by: Hao Xu > --- > Changes in v2: > - remove the macros inb_p/outb_p and use readq/writeq directly, per >

Re: [PATCH 1/2] staging: kpc2000: kpc2000_i2c: void* -> void *

2019-06-08 Thread Geordan Neukum
On Sat, Jun 08, 2019 at 03:27:46PM +0800, Hao Xu wrote: > modify void* to void * for #define inb_p(a) readq((void*)a) > and #define outb_p(d,a) writeq(d,(void*)a) > > Signed-off-by: Hao Xu > --- > drivers/staging/kpc2000/kpc2000_i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 3/6] staging: kpc2000: kpc_spi: remove unnecessary struct member word_len

2019-06-04 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 3 --- 1 file

[PATCH 5/6] staging: kpc2000: kpc_spi: remove unnecessary ulong repr of i/o addr

2019-06-04 Thread Geordan Neukum
) 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 --- drivers/staging/kpc2000/kpc2000_spi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging

[PATCH 4/6] staging: kpc2000: kpc_spi: remove unnecessary struct member chip_select

2019-06-04 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 2 -- 1 file

[PATCH 0/6] staging: kpc2000: kpc_spi: Assorted minor fixups

2019-06-04 Thread Geordan Neukum
Primarily just a bunch of unused / unnecessarily used struct member cleanup patches with the exception of one patch which removes an unnecessary cast to a (void *) in a couple of functions. Geordan Neukum (6): staging: kpc2000: kpc_spi: remove unnecessary struct member phys staging: kpc2000

[PATCH 2/6] staging: kpc2000: kpc_spi: remove unnecessary struct member pin_dir

2019-06-04 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 2 -- 1 file changed, 2

[PATCH 6/6] staging: kpc2000: kpc_spi: remove unnecessary cast in [read|write]_reg()

2019-06-04 Thread Geordan Neukum
operation. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 4f517afc6239..28132e9e260d 100644 --- a/drivers/staging/kpc2000

[PATCH 1/6] staging: kpc2000: kpc_spi: remove unnecessary struct member phys

2019-06-04 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 2 -- 1 file changed

[PATCH 3/5] staging: kpc2000: kpc_spi: remove fifo_depth from kp_spi struct

2019-06-02 Thread Geordan Neukum
The kp_spi structure contains a member 'fifo_depth'. This member is never used. Therefore, it should be removed. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_spi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging

[PATCH 2/5] staging: kpc2000: kpc_spi: column-align switch and subordinate cases

2019-06-02 Thread Geordan Neukum
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 --- drivers/staging

[PATCH 4/5] staging: kpc2000: kpc_spi: remove function kp_spi_bytes_per_word()

2019-06-02 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 14 -- 1 file changed, 14 deletions(-) diff

[PATCH 0/5] staging: kpc2000: kpc_spi: Assorted small fixes

2019-06-02 Thread Geordan Neukum
This patch set contains a few small fixups to the kpc_spi driver. There is certainly nothing groundbreaking in this patch set. It is limited to style fixups, removing unused things, and using the managed resource API for mapping I/O space. Geordan Neukum (5): staging: kpc2000: kpc_spi: Remove

[PATCH 5/5] staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O space

2019-06-02 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 3 ++- 1

[PATCH 1/5] staging: kpc2000: kpc_spi: Remove unnecessary consecutive newlines

2019-06-02 Thread Geordan Neukum
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 --- drivers/staging/kpc2000/kpc2000_spi.c | 13 - 1 file changed, 13

[PATCH 4/8] staging: kpc2000: kpc_i2c: Remove unnecessary consecutive newlines

2019-05-25 Thread Geordan Neukum
The kpc2000_i2c.c file contains instances of unnecessary consecutive newlines which impact the readability of the file. Remove these unnecessary newlines. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers

[PATCH 7/8] staging: kpc2000: kpc_i2c: fail probe if unable to map I/O space

2019-05-25 Thread Geordan Neukum
The kpc2000 driver does not verify whether or not mapping the I/O space succeeded during probe time. Make the driver verify that the mapping operation was successful before potentially using that area in the future. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 2

[PATCH 5/8] staging: kpc2000: kpc_i2c: Use drvdata instead of platform_data

2019-05-25 Thread Geordan Neukum
meant to be accessible in driver callbacks. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 1767f351a116

[PATCH 3/8] staging: kpc2000: kpc_i2c: Use BIT macro rather than manual bit shifting

2019-05-25 Thread Geordan Neukum
Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index b2a9cda05f1b..1d100bb7c548 100644 --- a/drivers/staging/k

[PATCH 8/8] staging: kpc2000: kpc_i2c: Use devm_* API to manage mapped I/O space

2019-05-25 Thread Geordan Neukum
The kpc_i2c 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 using the managed resource API. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 4 +++- 1 file changed

[PATCH 6/8] staging: kpc2000: kpc_i2c: fail probe if unable to get I/O resource

2019-05-25 Thread Geordan Neukum
The kpc_i2c driver attempts to map its I/O space without verifying whether or not the result of platform_get_resource() is NULL. Make the driver check that platform_get_resource did not return NULL before attempting to use the value returned to map an I/O space. Signed-off-by: Geordan Neukum

[PATCH 0/8] staging: kpc2000: kpc_i2c: assorted driver cleanup

2019-05-25 Thread Geordan Neukum
This series contains some patches aimed toward: - cleaning up unused/unneeded parts of driver state - a couple of small style fixups - a couple of API changes - better error handling in probe() in the kpc2000 i2c driver. Geordan Neukum (8): staging: kpc2000: kpc_i2c: Remove unused rw_sem

[PATCH 1/8] staging: kpc2000: kpc_i2c: Remove unused rw_sem

2019-05-25 Thread Geordan Neukum
In pi2c_probe, a rw_sem is initialized and stashed off in the i2c_device private runtime state struct. This rw_sem is never used after initialization. Remove the rw_sem and cleanup unneeded header inclusion. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 3 --- 1 file

[PATCH 2/8] staging: kpc2000: kpc_i2c: Remove pldev from i2c_device structure

2019-05-25 Thread Geordan Neukum
of type: struct i2c_device. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 2c272ad8eca6..b2a9cda05f1b 100644 --- a/drivers/staging

Re: [PATCH v2] staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000'

2019-05-23 Thread Geordan Neukum
On Fri, May 24, 2019 at 2:38 AM Geordan Neukum wrote: > + depends on MFD_CORE In order for this to work in menuconfig, this either needs to be a select or I need to add a prompt to MFD_CORE. I don't have strong feelings either way, but all other Kconfig options which are rela

[PATCH v2] staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000'

2019-05-23 Thread Geordan Neukum
The kpc2000 core makes calls against functions conditionally exported upon selection of the kconfig symbol MFD_CORE. Therefore, the kpc2000 core depends upon the mfd_core, and that dependency must be tracked in Kconfig to avoid potential build issues. Signed-off-by: Geordan Neukum --- v2 changes

Re: [PATCH 1/6] staging: kpc2000: make kconfig symbol 'KPC2000' select dependencies

2019-05-22 Thread Geordan Neukum
I can't even begin to speculate on that one. If someone could point me in the right direction there, I'd be happy to investigate further. Thanks again for your feedback all, Geordan Neukum

[PATCH 0/6] Minor updates to kpc_i2c driver and kpc2000 core

2019-05-22 Thread Geordan Neukum
Attached are an assortment of minor updates to the kpc_i2c driver as well as a build fix for all of those who will need the KPC2000 core. Thanks, Geordan Geordan Neukum (6): staging: kpc2000: make kconfig symbol 'KPC2000' select dependencies staging: kpc2000: kpc_i2c: remove unused module

[PATCH 1/6] staging: kpc2000: make kconfig symbol 'KPC2000' select dependencies

2019-05-22 Thread Geordan Neukum
. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/kpc2000/Kconfig b/drivers/staging/kpc2000/Kconfig index fb5922928f47..8992dc67ff37 100644 --- a/drivers/staging/kpc2000/Kconfig +++ b/drivers/staging/kpc2000

[PATCH 2/6] staging: kpc2000: kpc_i2c: remove unused module param disable_features

2019-05-22 Thread Geordan Neukum
The module parameter 'disable_features' is currently unused. Therefore, it should be removed. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000

[PATCH 6/6] staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c

2019-05-22 Thread Geordan Neukum
kpc_i2c.c declares: - two functions - pi2c_probe() - pi2c_remove() - one struct - i2c_plat_driver_i which are local to the file, yet missing the static qualifier. Add the static qualifier to these symbols. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c

[PATCH 4/6] staging: kpc2000: kpc_i2c: use instead of

2019-05-22 Thread Geordan Neukum
Rather than include asm/io.h, include linux/io.h. Issue reported by the script checkpatch.pl. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging

[PATCH 5/6] staging: kpc2000: kpc_i2c: Remove unnecessary function tracing prints

2019-05-22 Thread Geordan Neukum
-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 5d98ed54c05c..f9259c06b605 100644 --- a/drivers/staging/kpc2000

[PATCH 3/6] staging: kpc2000: kpc_i2c: newline fixups to meet linux style guide

2019-05-22 Thread Geordan Neukum
. 2) That the declaration of variables local to a given function should be immediately followed by a blank newline. Therefore, the single instance of this in kpc2000_i2c.c should be fixed up. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_i2c.c | 82

Re: [PATCH 0/5] Updates to staging driver: kpc_i2c

2019-05-21 Thread Geordan Neukum
> On Mon, May 20, 2019 at 10:30:26AM +0200, Greg Kroah-Hartman wrote: > > All now queued up. I'll rebase my patches that move this file on top of > yours, as kbuild found some problems with mine, and I'll resend them to > the list. > > Thanks. ** Same content as last reply, just realized that I

Re: [PATCH 0/5] Updates to staging driver: kpc_i2c

2019-05-21 Thread Geordan Neukum
On Mon, May 20, 2019 at 10:30:26AM +0200, Greg Kroah-Hartman wrote: > On Sat, May 18, 2019 at 02:29:55AM +0000, Geordan Neukum wrote: > > Attached are an assortment of updates to the kpc_i2c driver in the > > staging subtree. > > All now queued up. I'll rebase my patche

Re: [PATCH 4/5] staging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages

2019-05-17 Thread Geordan Neukum
On Fri, May 17, 2019 at 07:58:19PM -0700, Joe Perches wrote: > On Sat, 2019-05-18 at 02:29 +0000, Geordan Neukum wrote: > > Throughout i2c_driver.c, there are instances where the log strings > > contain the function's name hardcoded into the string. Instead, use the > > printk

[PATCH 1/5] staging: kpc2000: kpc_i2c: reindent i2c_driver.c

2019-05-17 Thread Geordan Neukum
i2c_driver.c uses a mixture of space and tab indentations which conflicts with the kernel coding style guide. Reindent i2c_driver.c. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 1014 +- 1 file changed, 507 insertions(+), 507 deletions

[PATCH 4/5] staging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages

2019-05-17 Thread Geordan Neukum
Throughout i2c_driver.c, there are instances where the log strings contain the function's name hardcoded into the string. Instead, use the printk conversion specifier '%s' with the __func__ preprocessor identifier to more maintainably print the function's name. Signed-off-by: Geordan Neukum

[PATCH 5/5] staging: kpc2000: kpc_i2c: fixup block comment style in i2c_driver.c

2019-05-17 Thread Geordan Neukum
consistent with the prescribed guidelines. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 36 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c b/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c

[PATCH 2/5] staging: kpc2000: kpc_i2c: reformat copyright for better readability

2019-05-17 Thread Geordan Neukum
The copyright header in i2c_driver.c is difficult to read and not chronologically ordered. Reformat and reorganize the copyright header to be similar to other drivers in the i2c subsystem. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 30

[PATCH 3/5] staging: kpc2000: kpc_i2c: prevent memory leak in probe() error case

2019-05-17 Thread Geordan Neukum
freeing of the memory in the remove() function. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c b/drivers/staging/kpc2000/kpc_i2c/i2c_driver.c index

[PATCH 0/5] Updates to staging driver: kpc_i2c

2019-05-17 Thread Geordan Neukum
attempted to look at some other drivers in the i2c subsystem for inspiration, but I'd be happy to drop this isn't as simple an update as it seems. Patch 3 addresses a potential bug in the cleanup of memory allocated in the probe method. Geordan Neukum (5): staging: kpc2000: kpc_i2c: reindent