From patchwork Mon Mar 18 17:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13595676 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 599885577F; Mon, 18 Mar 2024 17:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710783224; cv=none; b=t4MoiU7XGLWb4KUbKUV8r7HokTrPe8zwZCxF5QCRKtFYaPIWBsYRnRO091pBg4EtKHKGG/MdqGxtYLd87TtM7lywBXJzNcxWwEYTAFrs2lheScpBlgBtWXyYghyN4ZvYJ+gdMpuySQJfFnHxAjy+S1drzcdbSAGLkbDHJORzfIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710783224; c=relaxed/simple; bh=7wGuM9mUE2EIlFGIi5UGZhFZydUFDO6Zf0/5w2OPGUg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VdF9mHXHvsfwi1qnhLShkPv3tur4r/BZN/JSRaDRfTn/AAE6UD0hKU1DIQJT6S2MZGa+0mK5Y5omnCRHaoGZxlXEa4MZSfgvMKo203+VWd7Lym2jei7nJgB06XR20CTVKhQGhmrhKjDMACtiCBiSJFBWDgECxwb1l9nbDl7S5Gc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.07,134,1708354800"; d="scan'208";a="202167599" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 19 Mar 2024 02:33:35 +0900 Received: from localhost.localdomain (unknown [10.226.93.20]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 89C0140359EB; Tue, 19 Mar 2024 02:33:31 +0900 (JST) From: Biju Das To: Greg Kroah-Hartman Cc: Biju Das , Geert Uytterhoeven , Magnus Damm , Rob Herring , Yoshihiro Shimoda , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH v4 2/6] usb: renesas_usbhs: Simplify obtaining device data Date: Mon, 18 Mar 2024 17:33:15 +0000 Message-Id: <20240318173319.201799-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240318173319.201799-1-biju.das.jz@bp.renesas.com> References: <20240318173319.201799-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Simplify probe() by removing redundant dev->of_node check. While at it, replace dev_err->dev_err_probe for error path. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- v3->v4: * No change. v2->v3: * Added Rb tag from Geert. v2: * New patch. --- drivers/usb/renesas_usbhs/common.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index dd1c17542439..0c62e4c6c88d 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -595,16 +595,11 @@ static int usbhs_probe(struct platform_device *pdev) u32 tmp; int irq; - /* check device node */ - if (dev_of_node(dev)) - info = of_device_get_match_data(dev); - else - info = renesas_usbhs_get_info(pdev); - - /* check platform information */ + info = of_device_get_match_data(dev); if (!info) { - dev_err(dev, "no platform information\n"); - return -EINVAL; + info = renesas_usbhs_get_info(pdev); + if (!info) + return dev_err_probe(dev, -EINVAL, "no platform info\n"); } /* platform data */