From patchwork Fri Mar 15 18:41:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13593877 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 765234F5FA; Fri, 15 Mar 2024 18:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710528105; cv=none; b=eZoENi5hu4+o4oQnAvQV8p+bRoK3UYSLbqDYIxhZ7Ex2SYE4660qd2cH6A12Gn96KTkH62rxmVvzvTD61lILukXAauD+8wGHk1SCiPRmfwSZP64kFcjOg3acBt5TQKTMGPd4SQjj9+SLJT/Klr3jaFdbUiuIMqtqOYt8zDsx65A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710528105; c=relaxed/simple; bh=3TTfsFW0oRjIM/ny7kCePQLf+iRUVD0NSZl63OG8Xdo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FjrpZ+UXtN+DaI4v8Bf/8NGL6sjhDXo8OFRpkqU7hesoii9HvYD56FdCJOjVu0HdofC6J3g8iixvZoDH4oUWPLreSLgz06xkZho+lq9P6P5W8qM3Vx2fN65DqD4M2OvhwTPO7CkC4LHPJXyg0zIUuEx6lvSccVtSa8y7WuBDM6w= 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.171 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,129,1708354800"; d="scan'208";a="197917802" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Mar 2024 03:41:41 +0900 Received: from localhost.localdomain (unknown [10.226.93.102]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C120C40061BF; Sat, 16 Mar 2024 03:41:37 +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 v3 2/7] usb: renesas_usbhs: Simplify obtaining device data Date: Fri, 15 Mar 2024 18:41:35 +0000 Message-Id: <20240315184135.375916-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 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 --- 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 */