Skip to content

Commit a5f22b9

Browse files
committed
Merge tag 'staging-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 7.0-rc1. Well, not that big, just lots of tiny coding style cleanups primarily in one driver as everyone seems to have glomed onto it for some reason that escapes me (is there a tutorial out there somewhere pointing people at this?) Not much overall, the changes can be summarized as: - cleanups for the rtl8723bs driver, so many cleanups... - vme_user driver cleanups - sm750fb driver cleanups - tiny greybus driver cleanups - other really small staging driver cleanups All of these have been in linux-next for a while with no reported issues" * tag 'staging-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (119 commits) staging: rtl8723bs: refactor ODM_SetIQCbyRFpath to reduce duplication staging: rtl8723bs: rename CamelCase function Set_MSR to set_msr staging: rtl8723bs: remove unnecessary blank lines in rtw_io.c staging: rtl8723bs: remove stale TODO item regarding %pM staging: rtl8723bs: remove unused allocation wrapper functions staging: rtl8723bs: use standard skb allocation APIs staging: rtl8723bs: replace rtw_zmalloc() with kzalloc() staging: rtl8723bs: replace rtw_malloc() with kmalloc() staging: rtl8723bs: introduce kmemdup() where applicable staging: sm750fb: Clean up variable names staging: rtl8723bs: fix null dereference in find_network staging: rtl8723bs: use unaligned access macros in rtw_security.c staging: rtl8723bs: fix potential race in expire_timeout_chk staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c staging: rtl8723bs: modernize hex output in rtw_report_sec_ie staging: rtl8723bs: fix spacing around operators staging: rtl8723bs: rename u1bTmp to val staging: rtl8723bs: remove unused private debug counters staging: rtl8723bs: remove thread wraper functions and add IS_ERR() check staging: rtl8723bs: fix firmware memory leak on error ...
2 parents 505d195 + 319e3ff commit a5f22b9

63 files changed

Lines changed: 1111 additions & 1509 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/staging/axis-fifo/axis-fifo.c

Lines changed: 77 additions & 217 deletions
Large diffs are not rendered by default.

drivers/staging/greybus/TODO

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
* Convert all uses of the old GPIO API from <linux/gpio.h> to the
2-
GPIO descriptor API in <linux/gpio/consumer.h> and look up GPIO
3-
lines from device tree or ACPI.
4-
* Make pwm.c use the struct pwm_ops::apply instead of ::config, ::set_polarity,
5-
::enable and ::disable.

drivers/staging/greybus/arche-apb-ctrl.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
#include <linux/delay.h>
1111
#include <linux/gpio/consumer.h>
1212
#include <linux/interrupt.h>
13-
#include <linux/of_irq.h>
1413
#include <linux/module.h>
1514
#include <linux/pinctrl/consumer.h>
1615
#include <linux/platform_device.h>
1716
#include <linux/pm.h>
17+
#include <linux/property.h>
1818
#include <linux/regulator/consumer.h>
1919
#include <linux/spinlock.h>
20+
#include <linux/mod_devicetable.h>
2021
#include "arche_platform.h"
2122

2223
static void apb_bootret_deassert(struct device *dev);
@@ -314,8 +315,8 @@ static ssize_t state_show(struct device *dev,
314315

315316
static DEVICE_ATTR_RW(state);
316317

317-
static int apb_ctrl_get_devtree_data(struct platform_device *pdev,
318-
struct arche_apb_ctrl_drvdata *apb)
318+
static int apb_ctrl_get_fw_data(struct platform_device *pdev,
319+
struct arche_apb_ctrl_drvdata *apb)
319320
{
320321
struct device *dev = &pdev->dev;
321322
int ret;
@@ -378,7 +379,7 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev,
378379
}
379380

380381
/* Only applicable for platform >= V2 */
381-
if (of_property_read_bool(pdev->dev.of_node, "gb,spi-en-active-high"))
382+
if (device_property_read_bool(&pdev->dev, "gb,spi-en-active-high"))
382383
apb->spi_en_polarity_high = true;
383384

384385
return 0;
@@ -394,7 +395,7 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev)
394395
if (!apb)
395396
return -ENOMEM;
396397

397-
ret = apb_ctrl_get_devtree_data(pdev, apb);
398+
ret = apb_ctrl_get_fw_data(pdev, apb);
398399
if (ret) {
399400
dev_err(dev, "failed to get apb devicetree data %d\n", ret);
400401
return ret;
@@ -403,7 +404,7 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev)
403404
/* Initially set APB to OFF state */
404405
apb->state = ARCHE_PLATFORM_STATE_OFF;
405406
/* Check whether device needs to be enabled on boot */
406-
if (of_property_read_bool(pdev->dev.of_node, "arche,init-disable"))
407+
if (device_property_read_bool(&pdev->dev, "arche,init-disable"))
407408
apb->init_disabled = true;
408409

409410
platform_set_drvdata(pdev, apb);

drivers/staging/greybus/arche-platform.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -523,19 +523,19 @@ static int arche_platform_probe(struct platform_device *pdev)
523523

524524
arche_pdata->pm_notifier.notifier_call = arche_platform_pm_notifier;
525525
ret = register_pm_notifier(&arche_pdata->pm_notifier);
526-
527526
if (ret) {
528527
dev_err(dev, "failed to register pm notifier %d\n", ret);
529-
goto err_device_remove;
528+
goto err_depopulate;
530529
}
531530

532531
/* Explicitly power off if requested */
533532
if (!of_property_read_bool(pdev->dev.of_node, "arche,init-off")) {
534533
mutex_lock(&arche_pdata->platform_state_mutex);
535534
ret = arche_platform_coldboot_seq(arche_pdata);
536535
if (ret) {
536+
mutex_unlock(&arche_pdata->platform_state_mutex);
537537
dev_err(dev, "Failed to cold boot svc %d\n", ret);
538-
goto err_coldboot;
538+
goto err_unregister_pm_notifier;
539539
}
540540
arche_platform_wd_irq_en(arche_pdata);
541541
mutex_unlock(&arche_pdata->platform_state_mutex);
@@ -544,29 +544,22 @@ static int arche_platform_probe(struct platform_device *pdev)
544544
dev_info(dev, "Device registered successfully\n");
545545
return 0;
546546

547-
err_coldboot:
548-
mutex_unlock(&arche_pdata->platform_state_mutex);
547+
err_unregister_pm_notifier:
548+
unregister_pm_notifier(&arche_pdata->pm_notifier);
549+
err_depopulate:
550+
of_platform_depopulate(dev);
549551
err_device_remove:
550552
device_remove_file(&pdev->dev, &dev_attr_state);
551553
return ret;
552554
}
553555

554-
static int arche_remove_child(struct device *dev, void *unused)
555-
{
556-
struct platform_device *pdev = to_platform_device(dev);
557-
558-
platform_device_unregister(pdev);
559-
560-
return 0;
561-
}
562-
563556
static void arche_platform_remove(struct platform_device *pdev)
564557
{
565558
struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
566559

567560
unregister_pm_notifier(&arche_pdata->pm_notifier);
568561
device_remove_file(&pdev->dev, &dev_attr_state);
569-
device_for_each_child(&pdev->dev, NULL, arche_remove_child);
562+
of_platform_depopulate(&pdev->dev);
570563
arche_platform_poweroff_seq(arche_pdata);
571564

572565
if (usb3613_hub_mode_ctrl(false))
@@ -576,10 +569,10 @@ static void arche_platform_remove(struct platform_device *pdev)
576569
static __maybe_unused int arche_platform_suspend(struct device *dev)
577570
{
578571
/*
579-
* If timing profile premits, we may shutdown bridge
572+
* If timing profile permits, we may shutdown bridge
580573
* completely
581574
*
582-
* TODO: sequence ??
575+
* TODO: define shutdown sequence
583576
*
584577
* Also, need to make sure we meet precondition for unipro suspend
585578
* Precondition: Definition ???

drivers/staging/greybus/gb-camera.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <linux/v4l2-mediabus.h>
1111

1212
/* Input flags need to be set from the caller */
13-
#define GB_CAMERA_IN_FLAG_TEST (1 << 0)
13+
#define GB_CAMERA_IN_FLAG_TEST BIT(0)
1414
/* Output flags returned */
15-
#define GB_CAMERA_OUT_FLAG_ADJUSTED (1 << 0)
15+
#define GB_CAMERA_OUT_FLAG_ADJUSTED BIT(0)
1616

1717
/**
1818
* struct gb_camera_stream - Represents greybus camera stream.
@@ -89,8 +89,9 @@ struct gb_camera_csi_params {
8989
struct gb_camera_ops {
9090
ssize_t (*capabilities)(void *priv, char *buf, size_t len);
9191
int (*configure_streams)(void *priv, unsigned int *nstreams,
92-
unsigned int *flags, struct gb_camera_stream *streams,
93-
struct gb_camera_csi_params *csi_params);
92+
unsigned int *flags,
93+
struct gb_camera_stream *streams,
94+
struct gb_camera_csi_params *csi_params);
9495
int (*capture)(void *priv, u32 request_id,
9596
unsigned int streams, unsigned int num_frames,
9697
size_t settings_size, const void *settings);

drivers/staging/greybus/light.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,18 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id)
10081008
if (!strlen(conf.name))
10091009
return -EINVAL;
10101010

1011-
light->channels_count = conf.channel_count;
10121011
light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL);
10131012
if (!light->name)
10141013
return -ENOMEM;
1015-
light->channels = kcalloc(light->channels_count,
1014+
light->channels = kcalloc(conf.channel_count,
10161015
sizeof(struct gb_channel), GFP_KERNEL);
10171016
if (!light->channels)
10181017
return -ENOMEM;
1018+
/*
1019+
* Publish channels_count only after channels allocation so cleanup
1020+
* doesn't walk a NULL channels pointer on allocation failure.
1021+
*/
1022+
light->channels_count = conf.channel_count;
10191023

10201024
/* First we collect all the configurations for all channels */
10211025
for (i = 0; i < light->channels_count; i++) {

drivers/staging/greybus/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev,
806806

807807
mutex_init(&host->lock);
808808
spin_lock_init(&host->xfer);
809-
host->mrq_workqueue = alloc_workqueue("mmc-%s", 0, 1,
809+
host->mrq_workqueue = alloc_workqueue("mmc-%s", WQ_PERCPU, 1,
810810
dev_name(&gbphy_dev->dev));
811811
if (!host->mrq_workqueue) {
812812
ret = -ENOMEM;

drivers/staging/most/dim2/dim2.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ static inline struct dim2_hdm *iface_to_hdm(struct most_interface *iface)
113113
return container_of(iface, struct dim2_hdm, most_iface);
114114
}
115115

116-
/* Macro to identify a network status message */
117-
#define PACKET_IS_NET_INFO(p) \
118-
(((p)[1] == 0x18) && ((p)[2] == 0x05) && ((p)[3] == 0x0C) && \
119-
((p)[13] == 0x3C) && ((p)[14] == 0x00) && ((p)[15] == 0x0A))
116+
/* Identify a network status message */
117+
static bool packet_is_net_info(const u8 *p)
118+
{
119+
return p[1] == 0x18 && p[2] == 0x05 && p[3] == 0x0C &&
120+
p[13] == 0x3C && p[14] == 0x00 && p[15] == 0x0A;
121+
}
120122

121123
static ssize_t state_show(struct device *dev, struct device_attribute *attr,
122124
char *buf)
@@ -304,7 +306,7 @@ static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
304306

305307
if (hdm_ch->data_type == MOST_CH_ASYNC &&
306308
hdm_ch->direction == MOST_CH_RX &&
307-
PACKET_IS_NET_INFO(data)) {
309+
packet_is_net_info(data)) {
308310
retrieve_netinfo(dev, mbo);
309311

310312
spin_lock_irqsave(&dim_lock, flags);

drivers/staging/most/video/video.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static int comp_vdev_close(struct file *filp)
121121
struct comp_fh *fh = to_comp_fh(filp);
122122
struct most_video_dev *mdev = fh->mdev;
123123
struct mbo *mbo, *tmp;
124+
LIST_HEAD(free_list);
124125

125126
/*
126127
* We need to put MBOs back before we call most_stop_channel()
@@ -133,13 +134,14 @@ static int comp_vdev_close(struct file *filp)
133134

134135
spin_lock_irq(&mdev->list_lock);
135136
mdev->mute = true;
136-
list_for_each_entry_safe(mbo, tmp, &mdev->pending_mbos, list) {
137-
list_del(&mbo->list);
138-
spin_unlock_irq(&mdev->list_lock);
137+
list_replace_init(&mdev->pending_mbos, &free_list);
138+
spin_unlock_irq(&mdev->list_lock);
139+
140+
list_for_each_entry_safe(mbo, tmp, &free_list, list) {
141+
list_del_init(&mbo->list);
139142
most_put_mbo(mbo);
140-
spin_lock_irq(&mdev->list_lock);
141143
}
142-
spin_unlock_irq(&mdev->list_lock);
144+
143145
most_stop_channel(mdev->iface, mdev->ch_idx, &comp);
144146
mdev->mute = false;
145147

@@ -554,6 +556,7 @@ static int __init comp_init(void)
554556
static void __exit comp_exit(void)
555557
{
556558
struct most_video_dev *mdev, *tmp;
559+
LIST_HEAD(free_list);
557560

558561
/*
559562
* As the mostcore currently doesn't call disconnect_channel()
@@ -562,16 +565,15 @@ static void __exit comp_exit(void)
562565
* This must be fixed in core.
563566
*/
564567
spin_lock_irq(&list_lock);
565-
list_for_each_entry_safe(mdev, tmp, &video_devices, list) {
566-
list_del(&mdev->list);
567-
spin_unlock_irq(&list_lock);
568+
list_replace_init(&video_devices, &free_list);
569+
spin_unlock_irq(&list_lock);
568570

571+
list_for_each_entry_safe(mdev, tmp, &free_list, list) {
572+
list_del_init(&mdev->list);
569573
comp_unregister_videodev(mdev);
570574
v4l2_device_disconnect(&mdev->v4l2_dev);
571575
v4l2_device_put(&mdev->v4l2_dev);
572-
spin_lock_irq(&list_lock);
573576
}
574-
spin_unlock_irq(&list_lock);
575577

576578
most_deregister_configfs_subsys(&comp);
577579
most_deregister_component(&comp);

drivers/staging/nvec/nvec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
648648
break;
649649
case 2: /* first byte after command */
650650
if (status == (I2C_SL_IRQ | RNW | RCVD)) {
651-
udelay(33);
652651
if (nvec->rx->data[0] != 0x01) {
653652
dev_err(nvec->dev,
654653
"Read without prior read command\n");
@@ -660,6 +659,9 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
660659
nvec_tx_set(nvec);
661660
to_send = nvec->tx->data[0];
662661
nvec->tx->pos = 1;
662+
/* delay ACK due to AP20 HW Bug
663+
do not replace by usleep_range */
664+
udelay(33);
663665
} else if (status == (I2C_SL_IRQ)) {
664666
nvec->rx->data[1] = received;
665667
nvec->rx->pos = 2;

0 commit comments

Comments
 (0)