aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-02staging: most: cdev: fix chrdev_region leak in mod_exitSuresh Udipi1-1/+1
It looks like v4.18-rc1 commit [0] which upstreams mld-1.8.0 commit [1] missed to fix the memory leak in mod_exit function. Do it now. [0] aba258b7310167 ("staging: most: cdev: fix chrdev_region leak") [1] https://github.com/microchip-ais/linux/commit/a2d8f7ae7ea381 ("staging: most: cdev: fix leak for chrdev_region") Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Acked-by: Christian Gromm <christian.gromm@microchip.com> Fixes: aba258b73101 ("staging: most: cdev: fix chrdev_region leak") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-30staging: most: sound: pass correct device when creating a sound cardChristian Gromm1-1/+1
This patch fixes the usage of the wrong struct device when calling function snd_card_new. Reported-by: Eugeniu Rosca <erosca@de.adit-jv.com> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Fixes: 69c90cf1b2fa ("staging: most: sound: call snd_card_new with struct device") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25staging: most: core: replace strcpy() by strscpy()Gustavo A. R. Silva1-1/+1
The strcpy() function is being deprecated. Replace it by the safer strscpy() and fix the following Coverity warning: "You might overrun the 80-character fixed-size string iface->p->name by copying iface->description without checking the length." Addresses-Coverity-ID: 1444760 ("Copy into fixed size buffer") Fixes: 131ac62253db ("staging: most: core: use device description as name") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-21Merge 5.1-rc6 into staging-nextGreg Kroah-Hartman1-1/+1
We want the fixes in here as well as this resolves an iio driver merge issue. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19staging: most: configfs: Make mdev_link_list staticYueHaibing1-1/+1
Fix sparse warning: drivers/staging/most/configfs.c:34:18: warning: symbol 'mdev_link_list' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: Documentation: update driver documentationChristian Gromm2-51/+284
This patch updates the driver documentation files to reflect the latest changes regarding configfs. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> v2: - changed kernel version to 5.2 v3: v4: Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: configfs: add code for link removalChristian Gromm1-2/+36
This patch adds code that cleans up established links whenever the destroy attribute is set or if the config_item (directory) is being removed. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: configfs: make create attributes write-onlyChristian Gromm1-15/+2
Reading the create attribute that triggers the creation of a link to a certain channel is not necessary. Hence, it is being removed. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: allow speculative configurationChristian Gromm4-30/+53
This patch makes the driver accept a link configuration eventhough no device is attached to the bus. Instead the configuration is being applied as soon as a device is being registered with the core. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: core: remove attribute add_linkChristian Gromm1-61/+0
This patch removes the driver attribute add_link. It is not needed, because the link management is now done via configfs. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: usb: remove prefix from description tagChristian Gromm1-1/+1
This patch cuts off the usb_device prefix of the description string. It is not needed, as the interface type is already available with the interface attribute of a channel. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: core: make sysfs attributes read-onlyChristian Gromm1-115/+7
This patch changes the access flags of the channel attributes to read-only. This is needed, because configuration is done via configfs. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: enable configfs supportChristian Gromm5-3/+19
This patch enables the configfs functionality of the driver by registering the configfs subsystems and compiling the configfs part of the sources. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: sound: introduce new sound adapter managementChristian Gromm1-18/+23
This patch adapts the sound card management to the configfs changes. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: core: add configfs interface functionsChristian Gromm2-1/+157
This patch adds the core's interface to configfs file. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: change signature of function probe_channelChristian Gromm6-8/+12
This patch adds the param argument to the function parameter of the call-back probe_channel. This parameter is needed to configure the channels of an attached device. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: most: add new file configfs.cChristian Gromm1-0/+627
This patch adds the file configfs.c to the driver directory. The file registers the necessary subsystems with configfs in order to move the driver configuration from sysfs to configfs. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman7-0/+7
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman8-0/+8
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02staging: most: core: use device description as nameChristian Gromm1-1/+1
This patch uses the device description to clearly identity a device attached to the bus. It is needed as the currently useed mdevX notation is not sufficiant in case more than one network interface controller is being used at the same time. Cc: stable@vger.kernel.org Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: Replace '--help--' in Kconfig fileWentao Cai4-4/+4
Replace '--help--' with 'help' to silence checkpatch.pl warning: WARNING: prefer 'help' over '---help---' for new help texts Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: dim2: reg.h: Correct SPDX-License-IdentifierWentao Cai1-1/+1
Correct SPDX-License-Identifier comment characters to silence checkpatch.pl warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: dim2: sysfs.h: Correct SPDX-License-IdentifierWentao Cai1-1/+1
Correct SPDX-License-Identifier comment characters to silence checkpatch.pl warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: dim2: hal.h: Correct SPDX-License-IdentifierWentao Cai1-1/+1
Correct SPDX-License-Identifier comment characters to silence checkpatch.pl warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: dim2: errors.h: Correct SPDX-License-IdentifierWentao Cai1-1/+1
Correct SPDX-License-Identifier comment characters to silence checkpatch.pl warning: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: most: usb: Change '--help--' to 'help' in KconfigWentao Cai1-1/+1
Change '--help--' in Kconfig file to silence checkpatch.pl warning: WARNING: prefer 'help' over '---help---' for new help texts Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04staging: most: cdev: add missing check for cdev_add failureColin Ian King1-1/+4
Currently the call to cdev_add is missing a check for failure. Fix this by checking for failure and exiting via a new error path that ensures the allocated comp_channel struct is kfree'd. Detected by CoverityScan, CID#1462359 ("Unchecked return value") Fixes: 9bc79bbcd0c5 ("Staging: most: add MOST driver's aim-cdev module") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04staging: prefix header search paths with $(srctree)/Masahiro Yamada8-8/+8
Currently, the Kbuild core manipulates header search paths in a crazy way [1]. To fix this mess, I want all Makefiles to add explicit $(srctree)/ to the search paths in the srctree. Some Makefiles are already written in that way, but not all. The goal of this work is to make the notation consistent, and finally get rid of the gross hacks. Having whitespaces after -I does not matter since commit 48f6e3cf5bc6 ("kbuild: do not drop -I without parameter"). [1]: https://patchwork.kernel.org/patch/9632347/ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19staging: most: sound: replace snprintf with strscpyColin Ian King1-1/+1
Using snprintf without a format specifier is potentially risky if the string device_name contains format specifiers. Replace this with the safer and more efficient strscpy. Cleans up clang warning: drivers/staging/most/sound/sound.c:673:41: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: Documentation: add information to driver_usage fileChristian Gromm1-3/+13
This patch updates driver_usage.txt file to reflect the latest changes that this patch set introduces. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: sound: remove channel number from ALSA card's long nameChristian Gromm1-2/+1
Adding the channel number to the name of the sound card is wrong, as the card does not represent a single streaming channel of the MOST device. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: sound: use static name for ALSA cardChristian Gromm1-2/+2
This patch uses a static name for the sound card's short name and long name. Having the card names configurable doesn't make sense anymore, as the card represents the same physical hardware. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: sound: rename variableChristian Gromm1-8/+8
Since the channels of a MOST device are now being represented as individual PCM devices of one sound card, the variable card_name is not suitable anymore to describe them. Therefore, this patch renames the variable to device_name. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: sound: correct label nameChristian Gromm1-6/+6
This patch fixes the lable name that is used to jump to error handling section of function audio_probe_channel() in case something went wrong. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: most: sound: create one sound card w/ multiple PCM devices per MOST deviceChristian Gromm1-41/+89
This patch avoids that a sound card is created and registered with ALSA every time a channel is being linked. Instead the channels are hooked on the same card, which is registered not until the final link has been added to the component. The string provided by user space that used to be the card name becomes the PCM device name. The user space API to add a link is being expanded by a "create" flag to trigger the registration. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-09staging: most: use format specifier "%s" in snprintfColin Ian King1-1/+1
Passing string ch_data_type[i].name as the format specifier is potentially hazardous because it could (although very unlikely to) have a format specifier embedded in it causing issues when parsing the non-existent arguments to these. Follow best practice by using the "%s" format string for the string. Cleans up clang warning: format string is not a string literal (potentially insecure) [-Wformat-security] Fixes: e7f2b70fd3a9 ("staging: most: replace multiple if..else with table lookup") Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: most: usb: add release function for DCI deviceChristian Gromm1-1/+8
This patch adds the missing release function for the DCI device that frees the container structure it is embedded in. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: most: fix label namesChristian Gromm3-41/+41
This patch makes use of label names that say what the goto actually does, as recommended in the kernel documentation. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: most: video: fix registration of an empty comp core_componentColin Ian King1-2/+2
Currently we have structrues comp (which is empty) and comp_info being used to register and deregister the component. This mismatch in naming occurred from a previous commit that renamed aim_info to comp. Fix this to use consistent component naming in line with most/net, most/sound etc. This fixes the message two issues, one with a null empty name when loading the module: [ 1485.269515] most_core: registered new core component (null) and an Oops when removing the module: [ 1485.277971] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [ 1485.278648] PGD 0 P4D 0 [ 1485.279253] Oops: 0002 [#2] SMP PTI [ 1485.279847] CPU: 1 PID: 32629 Comm: modprobe Tainted: P D WC OE 4.18.0-8-generic #9 [ 1485.280442] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 [ 1485.281040] RIP: 0010:most_deregister_component+0x3c/0x70 [most_core] .. etc Fixes: 1b10a0316e2d ("staging: most: video: remove aim designators") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: most: net: make array 'broadcast' static, shrinks object sizeColin Ian King1-1/+1
Don't populate the array 'broadcast' on the stack but instead make it static. Makes the object code smaller by 53 bytes: Before: text data bss dec hex filename 10511 1521 448 12480 30c0 drivers/staging/most/net/net.o After: text data bss dec hex filename 10394 1585 448 12427 308b drivers/staging/most/net/net.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: most: do not make interface dependent attrs default for all channelsChristian Gromm1-0/+19
The channel attribute dbr_size is only relevant for the DIM2 interface. so is the packets_per_xact for USB. This patch cleans up the driver's ABI by not showing all attributes by default for each channel, but only on those they belong to. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: most: register channel device after init of struct membersChristian Gromm1-4/+4
This patch moves the call to device_register to the end of the channel initialization section that the devcie belongs to. It is needed to avoid NULL pointer dereferences once the device is registered with sysfs. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-18Merge tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-1/+1
Pull staging and IIO updates from Greg KH: "Here are the big staging/iio patches for 4.19-rc1. Lots of churn here, with tons of cleanups happening in staging drivers, a removal of an old crypto driver that no one was using (skein), and the addition of some new IIO drivers. Also added was a "gasket" driver from Google that needs loads of work and the erofs filesystem. Even with adding all of the new drivers and a new filesystem, we are only adding about 1000 lines overall to the kernel linecount, which shows just how much cleanup happened, and how big the unused crypto driver was. All of these have been in the linux-next tree for a while now with no reported issues" * tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (903 commits) staging:rtl8192u: Remove unused macro definitions - Style staging:rtl8192u: Add spaces around '+' operator - Style staging:rtl8192u: Remove stale comment - Style staging: rtl8188eu: remove unused mp_custom_oid.h staging: fbtft: Add spaces around / - Style staging: fbtft: Erases some repetitive usage of function name - Style staging: fbtft: Adjust some empty-line problems - Style staging: fbtft: Removes one nesting level to help readability - Style staging: fbtft: Changes gamma table to define. staging: fbtft: A bit more information on dev_err. staging: fbtft: Fixes some alignment issues - Style staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style staging: rtl8188eu: remove unused array dB_Invert_Table staging: rtl8188eu: remove whitespace, add missing blank line staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.c staging: rtl8188eu: remove whitespace - style staging: rtl8188eu: cleanup block comment - style staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.c staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.c staging: rtlwifi: refactor rtl_get_tcb_desc ...
2018-07-18ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc()Takashi Iwai1-1/+0
snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with somewhat special for vmalloc handling, but in the end, this turned to just the default handler, i.e. NULL. As the situation has never changed over decades, let's rip it off. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28staging: most: fix sparse warning Using plain integer as NULL pointerMarcin Ciupak1-1/+1
This patch fixes following sparse warning: Using plain integer as NULL pointer in drivers/staging/most/dim2/dim2.c Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: most: video: fix build warningsGreg Kroah-Hartman1-9/+0
Commit 7d7cdb4fa552 ("staging: most: video: remove debugging code") ended up adding a bunch of build warnings about unused variables. Fix that up by removing those variables as we don't need them anymore. Cc: Abdun Nihaal <abdun.nihaal@gmail.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 7d7cdb4fa552 ("staging: most: video: remove debugging code") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: most: video: remove debugging codeAbdun Nihaal1-23/+0
This patch removes debugging code in video.c that causes the following checkpatch warning: WARNING: Prefer using '\"%s...\", __func__' to using function's name in a string Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: most: usb: remove local variableChristian Gromm1-5/+4
This patch removes the local variable dev that is used to store the pointer to the usb_device whenever it is used only once. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: most: usb: fix usb_disconnect race conditionChristian Gromm1-6/+13
The functions usb_disconnect and usb_sndbulkpipe are racing for the struct usb_device, which might cause a null pointer dereference exception. This patch fixes this race condition by protecting the critical section inside the function hdm_enque with the io_mutex. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous dataChristian Gromm1-1/+2
This patch avoids setting the URB_ZERO_PACKET transfer flag for synchronous data. This is needed to prevent the host from sending an empty packet when data is aligned to an endpoint packet boundary. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>