Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LMAO-armv8 committed Jun 12, 2024
1 parent bad7c15 commit 0a8a5a2
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 90 deletions.
4 changes: 3 additions & 1 deletion drivers/irqchip/irq-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
bool force)
{
void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + gic_irq(d);
unsigned int cpu;
unsigned int cpu, shift = (gic_irq(d) % 4) * 8;
u32 val, mask, bit;
unsigned long flags;

gic_lock_irqsave(flags);
if (unlikely(d->common->state_use_accessors & IRQD_GIC_MULTI_TARGET)) {
Expand Down
1 change: 0 additions & 1 deletion drivers/media/v4l2-core/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,6 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
* Add to the queued buffers list, a buffer will stay on it until
* dequeued in dqbuf.
*/
orig_state = vb->state;
list_add_tail(&vb->queued_entry, &q->queued_list);
q->queued_count++;
q->waiting_for_buffers = false;
Expand Down
72 changes: 25 additions & 47 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,10 @@ enum rtl8152_flags {

/* Define these values to match your device */
#define VENDOR_ID_REALTEK 0x0bda
#define VENDOR_ID_MICROSOFT 0x045e
#define VENDOR_ID_SAMSUNG 0x04e8
#define VENDOR_ID_LENOVO 0x17ef
#define VENDOR_ID_LINKSYS 0x13b1
#define VENDOR_ID_TPLINK 0x2357
#define VENDOR_ID_NVIDIA 0x0955

Expand Down Expand Up @@ -1349,9 +1351,7 @@ static void intr_callback(struct urb *urb)
"Stop submitting intr, status %d\n", status);
return;
case -EOVERFLOW:
if (net_ratelimit())
netif_info(tp, intr, tp->netdev,
"intr status -EOVERFLOW\n");
netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n");
goto resubmit;
/* -EPIPE: should clear the halt */
default:
Expand Down Expand Up @@ -2953,26 +2953,9 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)

static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
{
if (enable) {
r8153_u1u2en(tp, false);
r8153_u2p3en(tp, false);
rtl_runtime_suspend_enable(tp, true);
} else {
rtl_runtime_suspend_enable(tp, false);

switch (tp->version) {
case RTL_VER_03:
case RTL_VER_04:
break;
case RTL_VER_05:
case RTL_VER_06:
default:
r8153_u2p3en(tp, true);
break;
}

r8153_u1u2en(tp, true);
}
rtl_runtime_suspend_enable(tp, enable);
tp->rtl_ops.u1u2_enable(tp, !enable);
tp->rtl_ops.u2p3_enable(tp, !enable);
}

static void rtl8153b_runtime_enable(struct r8152 *tp, bool enable)
Expand Down Expand Up @@ -5761,14 +5744,13 @@ static int rtl8152_close(struct net_device *netdev)
res = rtl_s5_wol(tp);
#endif
mutex_unlock(&tp->control);

usb_autopm_put_interface(tp->intf);
}
timeleft = wait_event_interruptible_timeout(tp->bottom_half_wait_q,
tp->bottom_half_event, (tp->bottom_half_wait_time)*HZ);
pr_info("%s : wait for end of rx_bottom , timeleft = %d\n", __func__, timeleft);

if (!res)
usb_autopm_put_interface(tp->intf);

free_all_mem(tp);

return res;
Expand Down Expand Up @@ -5948,15 +5930,8 @@ static void r8153_init(struct r8152 *tp)

ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001);

/* MAC clock speed down */
ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0);
ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0);
ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0);

r8153_power_cut_en(tp, false);
r8153_u1u2en(tp, true);
usb_enable_lpm(tp->udev);

/* MAC clock speed down */
ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
Expand Down Expand Up @@ -6557,7 +6532,7 @@ static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
switch (stringset) {
case ETH_SS_STATS:
memcpy(data, rtl8152_gstrings, sizeof(rtl8152_gstrings));
memcpy(data, *rtl8152_gstrings, sizeof(rtl8152_gstrings));
break;
}
}
Expand Down Expand Up @@ -7439,14 +7414,21 @@ static void rtl8152_disconnect(struct usb_interface *intf)
}
}

#define REALTEK_USB_DEVICE_INTERFACE_CLASS(vend, prod) \
USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)


#define REALTEK_USB_DEVICE_INTERFACE_CLASS_AND_INTERFACE_INFO(vend, prod) \
USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \
USB_CDC_SUBCLASS_ETHERNET, \
USB_CDC_PROTO_NONE) \
#define REALTEK_USB_DEVICE(vend, prod) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_INT_CLASS, \
.idVendor = (vend), \
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_VENDOR_SPEC \
}, \
{ \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO | \
USB_DEVICE_ID_MATCH_DEVICE, \
.idVendor = (vend), \
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_COMM, \
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
.bInterfaceProtocol = USB_CDC_PROTO_NONE

/* table of devices that work with this driver */
static const struct usb_device_id rtl8152_table[] = {
Expand All @@ -7458,13 +7440,11 @@ static const struct usb_device_id rtl8152_table[] = {
{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)},
{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e)},
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)},
{REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)},
{REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)},
Expand All @@ -7485,13 +7465,11 @@ static struct usb_driver rtl8152_driver = {
.pre_reset = rtl8152_pre_reset,
.post_reset = rtl8152_post_reset,
.supports_autosuspend = 1,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
.disable_hub_initiated_lpm = 1,
#endif
};

module_usb_driver(rtl8152_driver);

MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
32 changes: 10 additions & 22 deletions drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,15 +1601,8 @@ static int ufshcd_devfreq_target(struct device *dev,
}
spin_unlock_irqrestore(hba->host->host_lock, irq_flags);

pm_runtime_get_noresume(hba->dev);
if (!pm_runtime_active(hba->dev)) {
pm_runtime_put_noidle(hba->dev);
ret = -EAGAIN;
goto out;
}
start = ktime_get();
ret = ufshcd_devfreq_scale(hba, scale_up);
pm_runtime_put(hba->dev);

trace_ufshcd_profile_clk_scaling(dev_name(hba->dev),
(scale_up ? "up" : "down"),
Expand Down Expand Up @@ -4514,10 +4507,8 @@ static int __ufshcd_uic_hibern8_enter(struct ufs_hba *hba)
} else {
ret = -EAGAIN;
}
} else
ufshcd_vops_hibern8_notify(hba, UIC_CMD_DME_HIBER_ENTER,
POST_CHANGE);

}

return ret;
}

Expand Down Expand Up @@ -6635,13 +6626,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host;
struct ufs_hba *hba;
unsigned int tag;
u32 pos;
int err;
u8 resp = 0xF, lun;
u8 resp = 0xF;
struct ufshcd_lrb *lrbp;
unsigned long flags;

host = cmd->device->host;
hba = shost_priv(host);
tag = cmd->request->tag;

/* secure log */
#ifdef CONFIG_EXYNOS_SMC_LOGGING
Expand All @@ -6662,7 +6656,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)

/* clear the commands that were pending for corresponding LUN */
for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
if (hba->lrb[pos].lun == lun) {
if (hba->lrb[pos].lun == lrbp->lun) {
err = ufshcd_clear_cmd(hba, pos);
if (err)
break;
Expand Down Expand Up @@ -6791,7 +6785,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
dev_err(hba->dev,
"%s: cmd was completed, but without a notifying intr, tag = %d",
__func__, tag);
goto clean;
goto cleanup;
}

/* Print Transfer Request of aborted task */
Expand Down Expand Up @@ -6997,6 +6991,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba)
{
int err = 0;
int retries = MAX_HOST_RESET_RETRIES;
unsigned long flags;

int tag;

Expand Down Expand Up @@ -9841,13 +9836,6 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
struct Scsi_Host *host = hba->host;
struct device *dev = hba->dev;

/*
* dev_set_drvdata() must be called before any callbacks are registered
* that use dev_get_drvdata() (frequency scaling, clock scaling, hwmon,
* sysfs).
*/
dev_set_drvdata(dev, hba);

if (!mmio_base) {
dev_err(hba->dev,
"Invalid memory reference for mmio_base is NULL\n");
Expand Down Expand Up @@ -10018,4 +10006,4 @@ MODULE_AUTHOR("Santosh Yaragnavi <[email protected]>");
MODULE_AUTHOR("Vinayak Holikatti <[email protected]>");
MODULE_DESCRIPTION("Generic UFS host controller driver Core");
MODULE_LICENSE("GPL");
MODULE_VERSION(UFSHCD_DRIVER_VERSION);
MODULE_VERSION(UFSHCD_DRIVER_VERSION);
12 changes: 4 additions & 8 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ static void hub_release(struct kref *kref);
static int usb_reset_and_verify_device(struct usb_device *udev);
static int hub_port_disable(struct usb_hub *hub, int port1, int set_state);
static void hub_set_initial_usb2_lpm_policy(struct usb_device *udev);
static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1,
u16 portstatus);

static inline char *portspeed(struct usb_hub *hub, int portstatus)
{
Expand Down Expand Up @@ -4996,14 +4998,12 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
}

/* reset (non-USB 3.0 devices) and get descriptor */
usb_lock_port(port_dev);
status = hub_port_init(hub, udev, port1, i);
usb_unlock_port(port_dev);
if (status < 0)
goto loop;

mutex_unlock(hcd->address0_mutex);
usb_unlock_port(port_dev);
retry_locked = false;

if (udev->quirks & USB_QUIRK_DELAY_INIT)
msleep(2000);

Expand Down Expand Up @@ -5096,10 +5096,6 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
usb_ep0_reinit(udev);
release_devnum(udev);
hub_free_dev(udev);
if (retry_locked) {
mutex_unlock(hcd->address0_mutex);
usb_unlock_port(port_dev);
}
usb_put_dev(udev);
if ((status == -ENOTCONN) || (status == -ENOTSUPP))
break;
Expand Down
12 changes: 4 additions & 8 deletions drivers/usb/gadget/function/f_accessory.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ static struct usb_gadget_strings *acc_strings[] = {
NULL,
};

static struct acc_dev *_acc_dev;

struct acc_dev_ref {
struct kref kref;
struct acc_dev *acc_dev;
Expand Down Expand Up @@ -1353,13 +1355,9 @@ static void acc_function_disable(struct usb_function *f)

static int acc_setup(void)
{
struct acc_dev_ref *ref = &_acc_dev_ref;
struct acc_dev *dev;
int ret;

if (kref_read(&ref->kref))
return -EBUSY;

dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
Expand All @@ -1377,16 +1375,14 @@ static int acc_setup(void)

ret = misc_register(&acc_device);
if (ret)
goto err_zap_ptr;
goto err;

/* _acc_dev must be set before calling usb_gadget_register_driver */
_acc_dev = dev;

return 0;

err_zap_ptr:
ref->acc_dev = NULL;
err_free_dev:
err:
kfree(dev);
pr_err("USB accessory gadget driver failed to initialize\n");
return ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/function/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
dev->qmult = qmult;
snprintf(net->name, sizeof(net->name), "%s%%d", netname);

if (get_ether_addr(dev_addr, net->dev_addr)) {
net->addr_assign_type = NET_ADDR_RANDOM;
if (get_ether_addr(dev_addr, net->dev_addr))
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
Expand Down Expand Up @@ -1283,6 +1282,7 @@ int gether_register_netdev(struct net_device *net)
{
struct eth_dev *dev;
struct usb_gadget *g;
struct sockaddr sa;
int status;

if (!net->dev.parent)
Expand Down
2 changes: 1 addition & 1 deletion fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
error = -ELOOP;
if (ep_loop_check(ep, tf.file) != 0)
goto error_tgt_fput;
}
} else {
get_file(tf.file);
list_add(&tf.file->f_tfile_llink,
Expand All @@ -2104,6 +2103,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
}
}
}


/*
* Try to lookup the file inside our RB tree, Since we grabbed "mtx"
Expand Down

0 comments on commit 0a8a5a2

Please sign in to comment.