From e254f5683a9c4e98c6ea00a30a354c16db1b7f35 Mon Sep 17 00:00:00 2001 From: "he.he" Date: Tue, 29 Oct 2024 15:39:50 +0800 Subject: [PATCH] usb: clean usb coverity [1/1] PD#SWPL-190835 Problem: clean usb coverity Solution: clean usb coverity Verify: all Change-Id: I0522381ae418c83e1024c4edc1ca31eec2f6870b Signed-off-by: he.he --- drivers/usb/crg/crg_drd.c | 9 +++++---- drivers/usb/xhci_amlogic/xhci-mem-meson.c | 6 ------ drivers/usb/xhci_amlogic/xhci-meson.c | 2 -- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/usb/crg/crg_drd.c b/drivers/usb/crg/crg_drd.c index 3e81a1f84..d818ca5a7 100644 --- a/drivers/usb/crg/crg_drd.c +++ b/drivers/usb/crg/crg_drd.c @@ -89,17 +89,18 @@ static int crg_core_soft_reset(struct crg_drd *crg) if (crg->usb3_phy) usb_phy_init(crg->usb3_phy); - amlogic_crg_host_power(crg->usb2_phy, false, true); + if (crg->usb2_phy) + amlogic_crg_host_power(crg->usb2_phy, false, true); return 0; } static void crg_core_exit(struct crg_drd *crg) { - amlogic_crg_host_power(crg->usb2_phy, false, false); - - if (crg->usb2_phy) + if (crg->usb2_phy) { + amlogic_crg_host_power(crg->usb2_phy, false, false); usb_phy_shutdown(crg->usb2_phy); + } if (crg->usb3_phy) usb_phy_shutdown(crg->usb3_phy); diff --git a/drivers/usb/xhci_amlogic/xhci-mem-meson.c b/drivers/usb/xhci_amlogic/xhci-mem-meson.c index 67e6710c6..3a7506ab1 100644 --- a/drivers/usb/xhci_amlogic/xhci-mem-meson.c +++ b/drivers/usb/xhci_amlogic/xhci-mem-meson.c @@ -1075,8 +1075,6 @@ void stop_ep_cmd_work(struct work_struct *work) struct aml_xhci_virt_ep *eps = container_of(work, struct aml_xhci_virt_ep, stop_work); - if (!eps) - return; xhci = eps->xhci; if (eps->q_status_count == 0) eps->q_status_count = 12; @@ -1085,13 +1083,9 @@ void stop_ep_cmd_work(struct work_struct *work) u16 stat; udev = eps->udev; - if (!udev) - return; if (udev->state == USB_STATE_NOTATTACHED) return; for (i = 0; i < eps->q_status_count; i++) { - if (!udev) - return; if (udev->state == USB_STATE_NOTATTACHED) return; aml_xhci_usb_get_status(udev, USB_RECIP_ENDPOINT, diff --git a/drivers/usb/xhci_amlogic/xhci-meson.c b/drivers/usb/xhci_amlogic/xhci-meson.c index 59a3aa678..da7128719 100644 --- a/drivers/usb/xhci_amlogic/xhci-meson.c +++ b/drivers/usb/xhci_amlogic/xhci-meson.c @@ -179,8 +179,6 @@ int aml_xhci_start(struct aml_xhci_hcd *xhci) temp = readl(hcd->regs + 0x20b0); temp |= 1 << 26; writel(temp, hcd->regs + 0x20b0); - temp = readl(hcd->regs + 0x20b0); - temp = 0; } #endif