From patchwork Wed Aug 14 10:35:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13763291 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D53251B0118 for ; Wed, 14 Aug 2024 10:36:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723631768; cv=none; b=MKkahPdbUsNDAklyfipp68d1jqBhTGtD6oSj1RfmuL8tq+EnxArSOPsHoEhh1BCGySB0Rc5MeALjenlMDxpgIaAjf8VRxhhdGqgljlPNXJrDyMAFzf0z2JMBgs/xhaWOT2Zt0fnfRyKiASj+lFCMfgq1KHEHvHYJh3mWt72L/Oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723631768; c=relaxed/simple; bh=VJma9HGhkE1TDrQ1OhGJk9qHK29VLxq1nCdewcEacTo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T/1i2ZW/YqPrhCKF9n2V7b1zL8dceL6ojHvF0fB9CXzTI7EL50WloUvOVL4k/4R4TbJR1g9XJNKNi+ZMiGr5YCOrjc3oS9FuLPtlh/4flORuz2I0gTOBSAQvO83Uypy9r/zqvGKgMXPFr1HEUwk5CqkDZUv1TfKW2JRJBAwK3mo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jY4OHOkZ; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jY4OHOkZ" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-428119da952so45148125e9.0 for ; Wed, 14 Aug 2024 03:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723631765; x=1724236565; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=F1XB3SobLk7VZ//KTQh7GEC/+D2L+CRxij+/IGHYnPA=; b=jY4OHOkZOI6Gymf6GUFIBfV54RVg5LkuAsV5m1yVbdjo2zM0Bvs+Tgo87vJJu0yDjr npwXQerAmCsxBoc8quYwq+NnJY360e9f9WZaLvJMJI63syQsFxIixeF1oD4OAbdHpI2r t5Zh8I+yoPGMt+jFZzS7GeJYHsdOpz49pzeEDd1IsMdeJnSskdd+KfSwszLycCeWRs9j c/RC/pvl4sbrXamA8gh4yHrNEkzalLB7RcC6kxB2e4Jolf9tSrfE+ungHDYfN/P7UzI6 dK0L+w+xuQn0+VuCJpIL+zX5D87wheNX6WwJKkI6ozLqjk3/YU+X2WQxQGeR4jcqTltX TzfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723631765; x=1724236565; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F1XB3SobLk7VZ//KTQh7GEC/+D2L+CRxij+/IGHYnPA=; b=bdMCEaNqOE3dJGPkaLplefCD7LNGgb8YfZQoBjEu+EjTskhT81hi48W24qpoFP30JE 4EsdRpab8d1n14anUJTcVbh0Q8hJHFrGdmYWiWTjFKc35r97uoL5FPisafptwPeZkkW2 E+a3WZhL2z15gjV8frQNfK0BPB6+L28XMSM9kOwoYkMr4dimZSVBYvxCiX0Jy+NU1/q8 0o85cusPUilt4iAFeUSbAmtCXjalNlLJjxX31MVDZUsNtWyr943SFi+aewNVePdQz6pH /GyDG5O8vij3bDjYZs/5KT/d8hhcmZxErhjBD0O0srt8SNL4nDnB0iEY0ruf6jkqVE8B jG8w== X-Forwarded-Encrypted: i=1; AJvYcCWPDivY5jYsi1VAuaS+PFr1eLv775IWP3VcA23+VgA5jKW9VLIJQsDJGREelDySR+hPuoymaDGB6nRmlrXnTftuJNWL X-Gm-Message-State: AOJu0YynzlPi4MIr0l/487XRAmMG4Ab8qcbv7X3ObShiYQKvfyHw9WrY YDuQJvN2p/fDAP9rqSKMUK+4N/fyLOI2O19dj2VyO2DaA1PDxRNVD5XQt+yfSu4= X-Google-Smtp-Source: AGHT+IHu+Ec7SMXK44CW15aI6wvbF/SSdZgsQigQTDfjf8g51hhj14oMtIh5VGN/FNCI7LDZHb/OkA== X-Received: by 2002:a05:600c:310b:b0:426:8ee5:5d24 with SMTP id 5b1f17b1804b1-429dd23ce9dmr18887445e9.20.1723631765087; Wed, 14 Aug 2024 03:36:05 -0700 (PDT) Received: from [127.0.1.1] ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded3dd4dsm15501835e9.29.2024.08.14.03.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 03:36:04 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 14 Aug 2024 12:35:41 +0200 Subject: [PATCH 05/11] usb: dwc3: imx8mp: simplify with dev_err_probe Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-b4-cleanup-h-of-node-put-usb-v1-5-95481b9682bc@linaro.org> References: <20240814-b4-cleanup-h-of-node-put-usb-v1-0-95481b9682bc@linaro.org> In-Reply-To: <20240814-b4-cleanup-h-of-node-put-usb-v1-0-95481b9682bc@linaro.org> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Michal Simek Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1324; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=VJma9HGhkE1TDrQ1OhGJk9qHK29VLxq1nCdewcEacTo=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmvIiDZ4bAv7tVf6yyVs5Q8BDE0c30I/4lsc928 qm+fK7AL+6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZryIgwAKCRDBN2bmhouD 10D4D/oDgQvQBKScmFFH4ftXAiif3buhyX1tYwq/1dglDmk1dpS2Uom5hsUFuODAKTVkrgvS8I9 9ZBDxcK8lwLHgJsGEvv7wnENJ1ayzimyIU0FehRqrXwrvNKSkqVQUeJCECcCtIjs6mIbjSA49+n r+CKLXBd83EI5dLRl6jKhXrdyOSaZFAETUaHs2oZEf5vSG5js1KedY3wHxpRz/vbtkJaM5o1VK2 rP7MGvnPiaGhY6B7mEHEprCBBbNEPTqejUKyZUIwzg12xUfWw2x9RdMHURMyQrMJlrBiZIzlKGw bOW2gDzy2qWW9Q5/u/RBds4vyXhp47ojbXo11hHockv6+sHDUKg3wsMqQeDWC5uw8Vwo8VgPFZi N5BuVPl7VNp6CC0jCtVFpQqsumutnnByaPeMLryUa6ooemCfTAZ9OT/qIftpGHI3MCjKWsWgWP8 bKPy00IeGa7lFrjxYTtmDXmU27lo+tenGJyMdkO0NKuokFBi+4MgN9qo0cgmq8kQHNgGJAiTTXr A8qNtA04wUCvA7LBJYNyKQ1shog4fKrmVFGCZC8BdJNppG+sv0cNfDqAyq/idx6WHUL10VgRpRV +ax2dAU4fStY6PNV3LDjgL9lJjsoZC7ezHq+HxOJ+OHph0VyuqOSvKxXRxf3+Z+iyPpQRNCrm5W NR5sGcdIZ1Dozow== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use dev_err_probe() to make the error paths a bit simpler. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Frank Li Acked-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-imx8mp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 8c91e595d3b9..869b5e7c15ed 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -179,18 +179,14 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) } dwc3_imx->hsio_clk = devm_clk_get_enabled(dev, "hsio"); - if (IS_ERR(dwc3_imx->hsio_clk)) { - err = PTR_ERR(dwc3_imx->hsio_clk); - dev_err(dev, "Failed to get hsio clk, err=%d\n", err); - return err; - } + if (IS_ERR(dwc3_imx->hsio_clk)) + return dev_err_probe(dev, PTR_ERR(dwc3_imx->hsio_clk), + "Failed to get hsio clk\n"); dwc3_imx->suspend_clk = devm_clk_get_enabled(dev, "suspend"); - if (IS_ERR(dwc3_imx->suspend_clk)) { - err = PTR_ERR(dwc3_imx->suspend_clk); - dev_err(dev, "Failed to get suspend clk, err=%d\n", err); - return err; - } + if (IS_ERR(dwc3_imx->suspend_clk)) + return dev_err_probe(dev, PTR_ERR(dwc3_imx->suspend_clk), + "Failed to get suspend clk\n"); irq = platform_get_irq(pdev, 0); if (irq < 0)