summaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000
Commit message (Collapse)AuthorAgeFilesLines
...
* 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: removed misc device.Jeremy Sowden2019-06-032-127/+2
| | | | | | | | Now that all the card information is available via sysfs, the misc device is no longer necessary. Removed it. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: kpc2000: export more device attributes via sysfs.Jeremy Sowden2019-06-031-0/+57
| | | | | | | | | Added more read-only device attributes in order to expose all the information about the hardware which is available by calling read() or ioct() on the misc device associated with it. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge 5.2-rc3 into staging-nextGreg Kroah-Hartman2019-06-032-3/+3
|\ | | | | | | | | | | We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000'Geordan Neukum2019-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: kpc2000: double unlock in error handling in kpc_dma_transfer()Dan Carpenter2019-05-201-2/+0
| | | | | | | | | | | | | | | | | | The goto err_descr_too_many; calls unlock_engine() so this unlocks twice. Fixes: 7df95299b94a ("staging: kpc2000: Add DMA driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: kpc2000: Fix build error without CONFIG_UIOYueHaibing2019-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix gcc build error while CONFIG_UIO is not set ERROR: "uio_unregister_device" [drivers/staging/kpc2000/kpc2000/kpc2000.ko] undefined! ERROR: "__uio_register_device" [drivers/staging/kpc2000/kpc2000/kpc2000.ko] undefined! Add UIO Kconfig dependency to fix this. Reported-by: Hulk Robot <hulkci@huawei.com> Reported-by: kbuild test robot <lkp@intel.com> Fixes: 7dc7967fc39a ("staging: kpc2000: add initial set of Daktronics drivers") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: kpc2000: fix build error on xtensaMax Filippov2019-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kpc2000/kpc_dma/fileops.c includes asm/uaccess.h instead of linux/uaccess.h, which results in the following build error on xtensa architecture: In file included from drivers/staging/kpc2000/kpc_dma/fileops.c:11: arch/xtensa/include/asm/uaccess.h: In function ‘clear_user’: arch/xtensa/include/asm/uaccess.h:40:22: error: implicit declaration of function ‘uaccess_kernel’; ... #define __kernel_ok (uaccess_kernel()) ^~~~~~~~~~~~~~ Include linux/uaccess.h to fix that. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: replace bogus variable name in core.cSimon Sandström2019-05-301-13/+13
| | | | | | | | | | | | | | | | "struct kp2000_regs temp" has nothing to do with temperatures, so replace it with the more proper name "regs". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove extra spaces in core.cSimon Sandström2019-05-301-2/+2
| | | | | | | | | | | | | | | | Fixes checkpatch.pl error "foo __init bar" should be "foo __init bar" and "foo __exit bar" should be "foo __exit bar". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove extra blank line in core.cSimon Sandström2019-05-301-1/+0
| | | | | | | | | | | | | | Fixes checkpatch.pl check "Please don't use multiple blank lines". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Use devm_* API to manage mapped I/O spaceGeordan Neukum2019-05-301-1/+3
| | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: fail probe if unable to map I/O spaceGeordan Neukum2019-05-301-0/+2
| | | | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: fail probe if unable to get I/O resourceGeordan Neukum2019-05-301-0/+3
| | | | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Use drvdata instead of platform_dataGeordan Neukum2019-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | The kpc_i2c driver stashes private state data in the platform_data member of its device structure. In general, the platform_data structure is used for passing data to the driver during probe() rather than as a storage area for runtime state data. Instead, use the drvdata member for all state info meant to be accessible in driver callbacks. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Remove unnecessary consecutive newlinesGeordan Neukum2019-05-301-5/+0
| | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Use BIT macro rather than manual bit shiftingGeordan Neukum2019-05-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | The FEATURES_* symbols use bit shifting of the style (1 << k) in order to assign a certain meaning to the value of inividual bits being set in the value of a given variable. Instead, use the BIT() macro in order to improve readability and maintain consistency with the rest of the kernel. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Remove pldev from i2c_device structureGeordan Neukum2019-05-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | The i2c_device structure contains a member used to stash a pointer to a platform_device. The driver contains no cases of this member being used after initialization. Remove the unnecessary struct member and the initialization of this member in the sole instance where the driver creates a variable of type: struct i2c_device. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Remove unused rw_semGeordan Neukum2019-05-301-3/+0
| | | | | | | | | | | | | | | | | | | | 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 <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: Change to use DIV_ROUND_UPNishka Dasgupta2019-05-301-4/+1
| | | | | | | | | | | | | | Use macro DIV_ROUND_UP instead of an equivalent sequence of operations. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: fix typo in KconfigSimon Sandström2019-05-301-2/+2
| | | | | | | | | | | | | | Fixes two minor typos in kpc2000's Kconfig: s/Kaktronics/Daktronics Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove unnecessary oom messageSimon Sandström2019-05-241-3/+1
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warning "Possible unnecessary 'out of memory' message". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove unnecessary include in cell_probe.cSimon Sandström2019-05-241-1/+0
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warning "Use #include <linux/io.h> instead of <asm/io.h>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove unnecessary braces in cell_probe.cSimon Sandström2019-05-241-7/+4
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warnings "braces {} are not necessary for single statement blocks". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: use kzalloc(sizeof(var)...) in cell_probe.cSimon Sandström2019-05-241-1/+1
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warning "Prefer kzalloc(sizeof(*kudev)...) over kzalloc(sizeof(struct kpc_uio_device)...)" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove extra blank lines in cell_probe.cSimon Sandström2019-05-241-4/+0
| | | | | | | | | | | | | | Fixes checkpatch.pl warnings "Please don't use multiple blank lines". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: fix alignment issues in cell_probe.cSimon Sandström2019-05-241-19/+15
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warnings "Alignment should match open parenthesis" and "Lines should not end with a '('". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: add missing asterisk in commentSimon Sandström2019-05-241-1/+1
| | | | | | | | | | | | | | Fixes checkpatch.pl error "code indent should use tabs where possible". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: use __func__ in debug messagesSimon Sandström2019-05-241-7/+12
| | | | | | | | | | | | | | | | Fixes checkpatch.pl warning "Prefer using '"%s...", __func__' to using '<function name>', this function's name, in a string". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: add blank line after declarationsSimon Sandström2019-05-241-0/+4
| | | | | | | | | | | | | | Fixes checkpatch.pl warning "Missing a blank line after declarations". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: remove invalid spaces in cell_probe.cSimon Sandström2019-05-231-2/+2
| | | | | | | | | | | | | | | | Fixes checkpatch.pl error "space prohibited before/after that parenthesis". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: add space after comma in cell_probe.cSimon Sandström2019-05-231-1/+1
| | | | | | | | | | | | | | Fixes checkpatch.pl error "space required after that ','". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: add spaces around operators in cell_probe.cSimon Sandström2019-05-231-3/+3
| | | | | | | | | | | | | | Fixes checkpatch.pl warning "spaces preferred around that <op>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: fix invalid linebreaks in cell_probe.cSimon Sandström2019-05-231-5/+12
| | | | | | | | | | | | | | | | Fixes checkpatch.pl error "else should follow close brace '}'" and "trailing statements should be on next line". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: add space between ) and { in cell_probe.cSimon Sandström2019-05-231-18/+18
| | | | | | | | | | | | | | Fixes checkpatch.pl error "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: fix indent in cell_probe.cSimon Sandström2019-05-231-286/+286
| | | | | | | | | | | | | | Use tabs instead of spaces for indentation. Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: fix platform_no_drv_owner.cocci warningskbuild test robot2019-05-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | drivers/staging/kpc2000/kpc2000_i2c.c:652:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 43ad38191816 ("staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c") CC: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: kbuild test robot <lkp@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.cGeordan Neukum2019-05-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: Remove unnecessary function tracing printsGeordan Neukum2019-05-221-26/+0
| | | | | | | | | | | | | | | | | | | | | | Many of the functions in kpc_i2c log debug-level messages to the kernel log message buffer upon invocation. This is unnecessary, as debugging tools like kgdb, kdb, etc. or the tracing tool ftrace should be able to provide this same information. Therefore, remove these print statements. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: use <linux/io.h> instead of <asm/io.h>Geordan Neukum2019-05-221-1/+1
| | | | | | | | | | | | | | | | Rather than include asm/io.h, include linux/io.h. Issue reported by the script checkpatch.pl. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: newline fixups to meet linux style guideGeordan Neukum2019-05-221-53/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The linux coding style document states: 1) That braces should not be used where a single single statement will do. Therefore all instances of single block statements wrapped in braces that do not meet the qualifications of any of the exceptions to the rule should be fixed up. 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 <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: kpc_i2c: remove unused module param disable_featuresGeordan Neukum2019-05-221-4/+0
| | | | | | | | | | | | | | | | The module parameter 'disable_features' is currently unused. Therefore, it should be removed. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: removed superfluous NULL checks from device attribute ↵Jeremy Sowden2019-05-221-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | call-backs. All the attribute show call-backs check whether pcard is NULL. However, pci_set_drvdata(pdev, pcard) is called before the sysfs files are created during probe, and pci_set_drvdata(pdev, NULL) is not called until after they are destroyed during remove; therefore, pcard will not be NULL, and we can drop the checks. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: simplified kp2000_device retrieval in device attribute ↵Jeremy Sowden2019-05-221-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | call-backs. All the call-backs used the same formula to retrieve the pcard from dev: struct pci_dev *pdev = to_pci_dev(dev); struct kp2000_device *pcard; if (!pdev) return NULL; pcard = pci_get_drvdata(pdev); Since to_pci_dev is a wrapper for container_of, it will not return NULL, and since pci_get_drvdata just calls dev_get_drvdata on the dev member of pdev, this is equivalent to: struct kp2000_device *pcard = dev_get_drvdata(&(container_of(dev, struct pci_dev, dev)->dev)); and we can simplify it to: struct kp2000_device *pcard = dev_get_drvdata(dev); Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: use IDA to assign card numbers.Jeremy Sowden2019-05-222-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the next card number was assigned from a static int local variable. Replaced it with an IDA. Avoids the assignment of ever- increasing card-numbers by allowing them to be reused. Updated TODO. Corrected format-specifier for unsigned pcard->card_num. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: added separate show functions for readable kp device ↵Jeremy Sowden2019-05-221-33/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes, defined them as read-only, and declared them static. Defined separate simple show functions for each attribute instead of having a one big one containing a chain of conditionals. Replaced calls to scnprintf with sprintf since all the outputs are single integers. All the readable device attributes are read-only, so used DEVICE_ATTR_RO to define them. The definitions are only used to populate the kp_attr_list attribute array, so declared them as static. Fixes the following sparse warnings: drivers/staging/kpc2000/kpc2000/core.c:152:1: warning: symbol 'dev_attr_ssid' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:153:1: warning: symbol 'dev_attr_ddna' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:154:1: warning: symbol 'dev_attr_card_id' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:155:1: warning: symbol 'dev_attr_hw_rev' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:156:1: warning: symbol 'dev_attr_build' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:157:1: warning: symbol 'dev_attr_build_date' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:158:1: warning: symbol 'dev_attr_build_time' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:159:1: warning: symbol 'dev_attr_cpld_reg' was not declared. Should it be static? drivers/staging/kpc2000/kpc2000/core.c:161:1: warning: symbol 'dev_attr_cpld_reconfigure' was not declared. Should it be static? Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: added a helper to get struct kp2000_device from struct device.Jeremy Sowden2019-05-221-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attribute call-backs all use the same formula to get the pcard from dev: struct pci_dev *pdev = to_pci_dev(dev); struct kp2000_device *pcard; if (!pdev) return -ENXIO; pcard = pci_get_drvdata(pdev); if (!pcard) return -ENXIO; Added a function to reduce the duplicated code. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: kpc2000: improved formatting of core.c.Jeremy Sowden2019-05-221-347/+422
| | | | | | | | | | | | | | | | | | | | | | * Indented with tabs. * Broke lines over 80 columns where possible. * Removed braces from one-statement blocks. * Tidied up some comments. * Removed multiple blank lines. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>