diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 11:08:17 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 11:08:17 -0700 |
commit | bafb0762cb6a906eb4105cccfb3bcd90be7f40d2 (patch) | |
tree | 14ecb87c33bcf909e5b95c27cd694ded4ac1478c /drivers/char | |
parent | 44b1671fae88ce95b8c7b53acbc6ba71ca67db00 (diff) | |
parent | 3a6430ce462172caac7c73f4afd550ab0f105737 (diff) | |
download | linux-stable-bafb0762cb6a906eb4105cccfb3bcd90be7f40d2.tar.gz linux-stable-bafb0762cb6a906eb4105cccfb3bcd90be7f40d2.tar.bz2 linux-stable-bafb0762cb6a906eb4105cccfb3bcd90be7f40d2.zip |
Merge tag 'char-misc-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the big char/misc driver update for 4.14-rc1.
Lots of different stuff in here, it's been an active development cycle
for some reason. Highlights are:
- updated binder driver, this brings binder up to date with what
shipped in the Android O release, plus some more changes that
happened since then that are in the Android development trees.
- coresight updates and fixes
- mux driver file renames to be a bit "nicer"
- intel_th driver updates
- normal set of hyper-v updates and changes
- small fpga subsystem and driver updates
- lots of const code changes all over the driver trees
- extcon driver updates
- fmc driver subsystem upadates
- w1 subsystem minor reworks and new features and drivers added
- spmi driver updates
Plus a smattering of other minor driver updates and fixes.
All of these have been in linux-next with no reported issues for a
while"
* tag 'char-misc-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (244 commits)
ANDROID: binder: don't queue async transactions to thread.
ANDROID: binder: don't enqueue death notifications to thread todo.
ANDROID: binder: Don't BUG_ON(!spin_is_locked()).
ANDROID: binder: Add BINDER_GET_NODE_DEBUG_INFO ioctl
ANDROID: binder: push new transactions to waiting threads.
ANDROID: binder: remove proc waitqueue
android: binder: Add page usage in binder stats
android: binder: fixup crash introduced by moving buffer hdr
drivers: w1: add hwmon temp support for w1_therm
drivers: w1: refactor w1_slave_show to make the temp reading functionality separate
drivers: w1: add hwmon support structures
eeprom: idt_89hpesx: Support both ACPI and OF probing
mcb: Fix an error handling path in 'chameleon_parse_cells()'
MCB: add support for SC31 to mcb-lpc
mux: make device_type const
char: virtio: constify attribute_group structures.
Documentation/ABI: document the nvmem sysfs files
lkdtm: fix spelling mistake: "incremeted" -> "incremented"
perf: cs-etm: Fix ETMv4 CONFIGR entry in perf.data file
nvmem: include linux/err.h from header
...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/applicom.c | 2 | ||||
-rw-r--r-- | drivers/char/mwave/smapi.c | 48 | ||||
-rw-r--r-- | drivers/char/ppdev.c | 3 | ||||
-rw-r--r-- | drivers/char/tlclk.c | 2 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 2 | ||||
-rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 39 | ||||
-rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.h | 13 |
7 files changed, 58 insertions, 51 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index b67263d6e34b..c0a5b1f3a986 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -67,7 +67,7 @@ static char *applicom_pci_devnames[] = { "PCI2000PFB" }; -static struct pci_device_id applicom_pci_tbl[] = { +static const struct pci_device_id applicom_pci_tbl[] = { { PCI_VDEVICE(APPLICOM, PCI_DEVICE_ID_APPLICOM_PCIGENERIC) }, { PCI_VDEVICE(APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN) }, { PCI_VDEVICE(APPLICOM, PCI_DEVICE_ID_APPLICOM_PCI2000PFB) }, diff --git a/drivers/char/mwave/smapi.c b/drivers/char/mwave/smapi.c index 8c5411a8f33f..691f5898bb32 100644 --- a/drivers/char/mwave/smapi.c +++ b/drivers/char/mwave/smapi.c @@ -128,10 +128,11 @@ int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings) { int bRC = -EIO; unsigned short usAX, usBX, usCX, usDX, usDI, usSI; - unsigned short ausDspBases[] = { 0x0030, 0x4E30, 0x8E30, 0xCE30, 0x0130, 0x0350, 0x0070, 0x0DB0 }; - unsigned short ausUartBases[] = { 0x03F8, 0x02F8, 0x03E8, 0x02E8 }; - unsigned short numDspBases = 8; - unsigned short numUartBases = 4; + static const unsigned short ausDspBases[] = { + 0x0030, 0x4E30, 0x8E30, 0xCE30, + 0x0130, 0x0350, 0x0070, 0x0DB0 }; + static const unsigned short ausUartBases[] = { + 0x03F8, 0x02F8, 0x03E8, 0x02E8 }; PRINTK_1(TRACE_SMAPI, "smapi::smapi_query_DSP_cfg entry\n"); @@ -148,7 +149,7 @@ int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings) pSettings->bDSPEnabled = ((usCX & 0x0001) != 0); pSettings->usDspIRQ = usSI & 0x00FF; pSettings->usDspDMA = (usSI & 0xFF00) >> 8; - if ((usDI & 0x00FF) < numDspBases) { + if ((usDI & 0x00FF) < ARRAY_SIZE(ausDspBases)) { pSettings->usDspBaseIO = ausDspBases[usDI & 0x00FF]; } else { pSettings->usDspBaseIO = 0; @@ -176,7 +177,7 @@ int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings) pSettings->bModemEnabled = ((usCX & 0x0001) != 0); pSettings->usUartIRQ = usSI & 0x000F; - if (((usSI & 0xFF00) >> 8) < numUartBases) { + if (((usSI & 0xFF00) >> 8) < ARRAY_SIZE(ausUartBases)) { pSettings->usUartBaseIO = ausUartBases[(usSI & 0xFF00) >> 8]; } else { pSettings->usUartBaseIO = 0; @@ -205,15 +206,16 @@ int smapi_set_DSP_cfg(void) int bRC = -EIO; int i; unsigned short usAX, usBX, usCX, usDX, usDI, usSI; - unsigned short ausDspBases[] = { 0x0030, 0x4E30, 0x8E30, 0xCE30, 0x0130, 0x0350, 0x0070, 0x0DB0 }; - unsigned short ausUartBases[] = { 0x03F8, 0x02F8, 0x03E8, 0x02E8 }; - unsigned short ausDspIrqs[] = { 5, 7, 10, 11, 15 }; - unsigned short ausUartIrqs[] = { 3, 4 }; - - unsigned short numDspBases = 8; - unsigned short numUartBases = 4; - unsigned short numDspIrqs = 5; - unsigned short numUartIrqs = 2; + static const unsigned short ausDspBases[] = { + 0x0030, 0x4E30, 0x8E30, 0xCE30, + 0x0130, 0x0350, 0x0070, 0x0DB0 }; + static const unsigned short ausUartBases[] = { + 0x03F8, 0x02F8, 0x03E8, 0x02E8 }; + static const unsigned short ausDspIrqs[] = { + 5, 7, 10, 11, 15 }; + static const unsigned short ausUartIrqs[] = { + 3, 4 }; + unsigned short dspio_index = 0, uartio_index = 0; PRINTK_5(TRACE_SMAPI, @@ -221,11 +223,11 @@ int smapi_set_DSP_cfg(void) mwave_3780i_irq, mwave_3780i_io, mwave_uart_irq, mwave_uart_io); if (mwave_3780i_io) { - for (i = 0; i < numDspBases; i++) { + for (i = 0; i < ARRAY_SIZE(ausDspBases); i++) { if (mwave_3780i_io == ausDspBases[i]) break; } - if (i == numDspBases) { + if (i == ARRAY_SIZE(ausDspBases)) { PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_3780i_io address %x. Aborting.\n", mwave_3780i_io); return bRC; } @@ -233,22 +235,22 @@ int smapi_set_DSP_cfg(void) } if (mwave_3780i_irq) { - for (i = 0; i < numDspIrqs; i++) { + for (i = 0; i < ARRAY_SIZE(ausDspIrqs); i++) { if (mwave_3780i_irq == ausDspIrqs[i]) break; } - if (i == numDspIrqs) { + if (i == ARRAY_SIZE(ausDspIrqs)) { PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_3780i_irq %x. Aborting.\n", mwave_3780i_irq); return bRC; } } if (mwave_uart_io) { - for (i = 0; i < numUartBases; i++) { + for (i = 0; i < ARRAY_SIZE(ausUartBases); i++) { if (mwave_uart_io == ausUartBases[i]) break; } - if (i == numUartBases) { + if (i == ARRAY_SIZE(ausUartBases)) { PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_uart_io address %x. Aborting.\n", mwave_uart_io); return bRC; } @@ -257,11 +259,11 @@ int smapi_set_DSP_cfg(void) if (mwave_uart_irq) { - for (i = 0; i < numUartIrqs; i++) { + for (i = 0; i < ARRAY_SIZE(ausUartIrqs); i++) { if (mwave_uart_irq == ausUartIrqs[i]) break; } - if (i == numUartIrqs) { + if (i == ARRAY_SIZE(ausUartIrqs)) { PRINTK_ERROR(KERN_ERR_MWAVE "smapi::smapi_set_DSP_cfg: Error: Invalid mwave_uart_irq %x. Aborting.\n", mwave_uart_irq); return bRC; } diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 3e73bcdf9e65..d256110ba672 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -101,9 +101,6 @@ static DEFINE_IDA(ida_index); #define PP_BUFFER_SIZE 1024 #define PARDEVICE_MAX 8 -/* ROUND_UP macro from fs/select.c */ -#define ROUND_UP(x,y) (((x)+(y)-1)/(y)) - static DEFINE_MUTEX(pp_do_mutex); /* define fixed sized ioctl cmd for y2038 migration */ diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 572a51704e67..6210bff46341 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c @@ -766,7 +766,7 @@ static struct attribute *tlclk_sysfs_entries[] = { NULL }; -static struct attribute_group tlclk_attribute_group = { +static const struct attribute_group tlclk_attribute_group = { .name = NULL, /* put in device directory */ .attrs = tlclk_sysfs_entries, }; diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 4d229dde6522..23f33f95d4a6 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1308,7 +1308,7 @@ static struct attribute *port_sysfs_entries[] = { NULL }; -static struct attribute_group port_attribute_group = { +static const struct attribute_group port_attribute_group = { .name = NULL, /* put in device directory */ .attrs = port_sysfs_entries, }; diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 3e6b23c3453c..067396bedf22 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c @@ -86,8 +86,7 @@ #include <linux/cdev.h> #include <linux/platform_device.h> #include <linux/slab.h> - -#include <asm/io.h> +#include <linux/io.h> #include <linux/uaccess.h> #ifdef CONFIG_OF @@ -222,6 +221,8 @@ static const struct config_registers v6_config_registers = { * hwicap_command_desync - Send a DESYNC command to the ICAP port. * @drvdata: a pointer to the drvdata. * + * Returns: '0' on success and failure value on error + * * This command desynchronizes the ICAP After this command, a * bitstream containing a NULL packet, followed by a SYNCH packet is * required before the ICAP will recognize commands. @@ -251,10 +252,12 @@ static int hwicap_command_desync(struct hwicap_drvdata *drvdata) * hwicap_get_configuration_register - Query a configuration register. * @drvdata: a pointer to the drvdata. * @reg: a constant which represents the configuration - * register value to be returned. - * Examples: XHI_IDCODE, XHI_FLR. + * register value to be returned. + * Examples: XHI_IDCODE, XHI_FLR. * @reg_data: returns the value of the register. * + * Returns: '0' on success and failure value on error + * * Sends a query packet to the ICAP and then receives the response. * The icap is left in Synched state. */ @@ -320,7 +323,8 @@ static int hwicap_initialize_hwicap(struct hwicap_drvdata *drvdata) dev_dbg(drvdata->dev, "initializing\n"); /* Abort any current transaction, to make sure we have the - * ICAP in a good state. */ + * ICAP in a good state. + */ dev_dbg(drvdata->dev, "Reset...\n"); drvdata->config->reset(drvdata); @@ -632,7 +636,6 @@ static int hwicap_setup(struct device *dev, int id, drvdata = kzalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL); if (!drvdata) { - dev_err(dev, "Couldn't allocate device private record\n"); retval = -ENOMEM; goto failed0; } @@ -759,20 +762,20 @@ static int hwicap_of_probe(struct platform_device *op, id = of_get_property(op->dev.of_node, "port-number", NULL); /* It's most likely that we're using V4, if the family is not - specified */ + * specified + */ regs = &v4_config_registers; family = of_get_property(op->dev.of_node, "xlnx,family", NULL); if (family) { - if (!strcmp(family, "virtex2p")) { + if (!strcmp(family, "virtex2p")) regs = &v2_config_registers; - } else if (!strcmp(family, "virtex4")) { + else if (!strcmp(family, "virtex4")) regs = &v4_config_registers; - } else if (!strcmp(family, "virtex5")) { + else if (!strcmp(family, "virtex5")) regs = &v5_config_registers; - } else if (!strcmp(family, "virtex6")) { + else if (!strcmp(family, "virtex6")) regs = &v6_config_registers; - } } return hwicap_setup(&op->dev, id ? *id : -1, &res, config, regs); @@ -802,20 +805,20 @@ static int hwicap_drv_probe(struct platform_device *pdev) return -ENODEV; /* It's most likely that we're using V4, if the family is not - specified */ + * specified + */ regs = &v4_config_registers; family = pdev->dev.platform_data; if (family) { - if (!strcmp(family, "virtex2p")) { + if (!strcmp(family, "virtex2p")) regs = &v2_config_registers; - } else if (!strcmp(family, "virtex4")) { + else if (!strcmp(family, "virtex4")) regs = &v4_config_registers; - } else if (!strcmp(family, "virtex5")) { + else if (!strcmp(family, "virtex5")) regs = &v5_config_registers; - } else if (!strcmp(family, "virtex6")) { + else if (!strcmp(family, "virtex6")) regs = &v6_config_registers; - } } return hwicap_setup(&pdev->dev, pdev->id, res, diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.h b/drivers/char/xilinx_hwicap/xilinx_hwicap.h index 38b145eaf24d..6b963d1c8ba3 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.h +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.h @@ -62,11 +62,13 @@ struct hwicap_drvdata { struct hwicap_driver_config { /* Read configuration data given by size into the data buffer. - Return 0 if successful. */ + * Return 0 if successful. + */ int (*get_configuration)(struct hwicap_drvdata *drvdata, u32 *data, u32 size); /* Write configuration data given by size from the data buffer. - Return 0 if successful. */ + * Return 0 if successful. + */ int (*set_configuration)(struct hwicap_drvdata *drvdata, u32 *data, u32 size); /* Get the status register, bit pattern given by: @@ -193,11 +195,12 @@ struct config_registers { * hwicap_type_1_read - Generates a Type 1 read packet header. * @reg: is the address of the register to be read back. * + * Return: * Generates a Type 1 read packet header, which is used to indirectly * read registers in the configuration logic. This packet must then * be sent through the icap device, and a return packet received with * the information. - **/ + */ static inline u32 hwicap_type_1_read(u32 reg) { return (XHI_TYPE_1 << XHI_TYPE_SHIFT) | @@ -208,7 +211,9 @@ static inline u32 hwicap_type_1_read(u32 reg) /** * hwicap_type_1_write - Generates a Type 1 write packet header * @reg: is the address of the register to be read back. - **/ + * + * Return: Type 1 write packet header + */ static inline u32 hwicap_type_1_write(u32 reg) { return (XHI_TYPE_1 << XHI_TYPE_SHIFT) | |