Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp199372pxu; Fri, 4 Dec 2020 00:40:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHm5ncMBYwHnpOPOMC3oJ1rfzA2cGFTOEihYMO9cNqkLyYr0GDaxmGL50amvpDAj9eiF/B X-Received: by 2002:a17:907:38a:: with SMTP id ss10mr6051498ejb.118.1607071222080; Fri, 04 Dec 2020 00:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607071222; cv=none; d=google.com; s=arc-20160816; b=ltG59pIGRDryFvcLVBQCrTT1Z3qnVIJashgJ6YN/YRaCsiqJ0EcKs6LwRt6DtAeXfH cZgrRayCxZXB/TmbCp/IvHzIcMTuHA85ctc3DTAh1npz4gvfhL/LAY9Hsw98E1dhNUh+ 0Mh4wCsE96tr0fmM3PNvKcxlhf8IcYDKStcIp+1rNhIoUs5k4NcOGbuE9OFd1Mt69wFb m3BNw2FZ+3FmogULPQRTEWK9dAk40kEU+XZNPs4CdPONg99S3yOshwV9k/JojsnfVPS8 cNbhs+hFG2rjOnuzbOYiVH2/RqrNr+tbyDDzCX1SHqr1OJf6QnH06SWIfg4prLL0joaw p/DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=U7niew6fp/uiegiq7dMm4u7gS+u3h3j+SCgY7YfDB/4=; b=gYwMg3V8AGTXerZOipt8U/I/tc25g39IkPABUzdIU2j3RiNd8KONAoorFHS2AsJ6k7 RGBUMez92PjTyLLUOduN+iW1y0cXTZ/fEdRMQTUQ0IqnOBqqgC258LYfvyMjU9AUWwAi SDwQpO6Lc6SrocYpyu9Xn1uyDrGNOPayemnGf4ULOAkatK40A9wo5RQjbWNmHQweL/BN bntZgU1qVUXXs6vUcs6Mi9GO43VUaYLQQfpNOvBLYQg3wImfiEQUov652SvOSo5irFFP OUAqLy4NxXZZ1KINJ7Mu97vr6/593h1qRoqJh9gW3aFNH7y2Axy8Du1HkxM9kFd9roSS WGGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si2428955edl.16.2020.12.04.00.39.58; Fri, 04 Dec 2020 00:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728888AbgLDIhq (ORCPT + 99 others); Fri, 4 Dec 2020 03:37:46 -0500 Received: from smtp21.cstnet.cn ([159.226.251.21]:56436 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725969AbgLDIhq (ORCPT ); Fri, 4 Dec 2020 03:37:46 -0500 Received: from localhost.localdomain (unknown [124.16.141.242]) by APP-01 (Coremail) with SMTP id qwCowAC3v1cg9clf1czZAA--.26586S2; Fri, 04 Dec 2020 16:36:49 +0800 (CST) From: Xu Wang To: hminas@synopsys.com, gregkh@linuxfoundation.org, p.zabel@pengutronix.de, lgirdwood@gmail.com, broonie@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: dwc2: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Date: Fri, 4 Dec 2020 08:36:44 +0000 Message-Id: <20201204083644.2704-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: qwCowAC3v1cg9clf1czZAA--.26586S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZFy8CFyfJF4DuFW8uF4UArb_yoWD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: linux-kernel@vger.kernel.org Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Xu Wang --- drivers/usb/dwc2/platform.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5f18acac7406..ba2b491c7f82 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -143,11 +143,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) if (ret) return ret; - if (hsotg->clk) { - ret = clk_prepare_enable(hsotg->clk); - if (ret) - return ret; - } + ret = clk_prepare_enable(hsotg->clk); + if (ret) + return ret; if (hsotg->uphy) { ret = usb_phy_init(hsotg->uphy); @@ -195,8 +193,7 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg) if (ret) return ret; - if (hsotg->clk) - clk_disable_unprepare(hsotg->clk); + clk_disable_unprepare(hsotg->clk); return 0; } -- 2.17.1