From patchwork Mon Feb 11 10:36:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10805497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 369D96C2 for ; Mon, 11 Feb 2019 10:37:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 261A329E33 for ; Mon, 11 Feb 2019 10:37:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AC2C29F50; Mon, 11 Feb 2019 10:37:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAA0929E33 for ; Mon, 11 Feb 2019 10:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbfBKKhM (ORCPT ); Mon, 11 Feb 2019 05:37:12 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53286 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbfBKKhL (ORCPT ); Mon, 11 Feb 2019 05:37:11 -0500 Received: by mail-wm1-f65.google.com with SMTP id d15so16811212wmb.3 for ; Mon, 11 Feb 2019 02:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ORsjA8hmqOYVa1A6z58C/tpqF85yI2kmPo177hZON40=; b=uLye05mHf5U4mdu8gXtjfTR+N3aOWDgsG2T1ERC4B3Socyqgmm/3fxEawS5ubPSdFG B/ugTQ69/ccJCN00HR4Lcd5V4LlAZZKtW1s8Og3uVxvxvXrVJyE11GUsT9OsoPTGzUHM KuzWsf48SBy2Y5Bus0/mXAoubrViDagkXNF2DHWvAg8468CqDAeNXfahxXHfjuX+acWV v+sU48xODUB6NESxzJW5iJF4xcMRX9IPNV7u8mxCsTi/tTgI90a5scml1fnBDrVw1L4i fdXYERqFuxqjpOg1epP/K3xE6iVPojWA+jj910LrTB/6BG8TRWFPJwSHGeuqSaBOuHeZ Djyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ORsjA8hmqOYVa1A6z58C/tpqF85yI2kmPo177hZON40=; b=WYa1oQHX9VdXoC9pHuddM8KxAdEI0boSdtfSwJfdD2sHizfQJ3ftcgcdpq9Ru0SVWp 6dVHqGqNyeRFhrkVyJrEer8w8OWHnMduiRJEbc5fwL98bvunlj+BRCC8RorNUkPx14O2 ypqmlLuM20JVTNPtyYLD4FvI3DeDtDZ4GOrfP89QmqquxbKyba46pgb5nJ5tlULaRMSk 3KSvBPcfMfUDQEJeHCv3oJK+/hVSHQ2ItUGHwSfTisef7dKkc11sUhxi1H8SpkOV6VvC Fmt2ZYiXAi4LQll35lXUSXeBybzmrtuu84VT7L868Kno5r8FjQRo6Ped7vw9mA0dQIYh cTUw== X-Gm-Message-State: AHQUAuZ+xyxnVl68pS8qnq3hhnyeWg/o4PWyB48ZJAuOLoAvhyIekdy8 Qzetlh+uZ1J1zq45qwMnXHdE+Q== X-Google-Smtp-Source: AHgI3Ib/RRpS7Aag0oclwa7+AqIq9+WfvoGs3rvHUtSqAKvhDoU0qM6dtbyLVU0XyAbi8y51UGZqXw== X-Received: by 2002:a1c:2408:: with SMTP id k8mr8550037wmk.110.1549881428735; Mon, 11 Feb 2019 02:37:08 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id i192sm11121275wmg.7.2019.02.11.02.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 02:37:08 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Alan Stern , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Subject: [PATCH v2 2/8] usb: ohci-da8xx: add a helper pointer to &pdev->dev Date: Mon, 11 Feb 2019 11:36:56 +0100 Message-Id: <20190211103702.4277-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211103702.4277-1-brgl@bgdev.pl> References: <20190211103702.4277-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Add a helper pointer to &pdev->dev. This improves readability by removing all the &pdev->dev dereferencing. Signed-off-by: Bartosz Golaszewski Acked-by: Alan Stern --- drivers/usb/host/ohci-da8xx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index c492c7e6f746..e8ede0b5e3f0 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -402,35 +402,35 @@ MODULE_DEVICE_TABLE(of, da8xx_ohci_ids); static int ohci_da8xx_probe(struct platform_device *pdev) { struct da8xx_ohci_hcd *da8xx_ohci; + struct device *dev = &pdev->dev; struct usb_hcd *hcd; struct resource *mem; int error, irq; - hcd = usb_create_hcd(&ohci_da8xx_hc_driver, &pdev->dev, - dev_name(&pdev->dev)); + hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev)); if (!hcd) return -ENOMEM; da8xx_ohci = to_da8xx_ohci(hcd); da8xx_ohci->hcd = hcd; - da8xx_ohci->usb11_clk = devm_clk_get(&pdev->dev, NULL); + da8xx_ohci->usb11_clk = devm_clk_get(dev, NULL); if (IS_ERR(da8xx_ohci->usb11_clk)) { error = PTR_ERR(da8xx_ohci->usb11_clk); if (error != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to get clock.\n"); + dev_err(dev, "Failed to get clock.\n"); goto err; } - da8xx_ohci->usb11_phy = devm_phy_get(&pdev->dev, "usb-phy"); + da8xx_ohci->usb11_phy = devm_phy_get(dev, "usb-phy"); if (IS_ERR(da8xx_ohci->usb11_phy)) { error = PTR_ERR(da8xx_ohci->usb11_phy); if (error != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to get phy.\n"); + dev_err(dev, "Failed to get phy.\n"); goto err; } - da8xx_ohci->vbus_reg = devm_regulator_get_optional(&pdev->dev, "vbus"); + da8xx_ohci->vbus_reg = devm_regulator_get_optional(dev, "vbus"); if (IS_ERR(da8xx_ohci->vbus_reg)) { error = PTR_ERR(da8xx_ohci->vbus_reg); if (error == -ENODEV) { @@ -438,13 +438,13 @@ static int ohci_da8xx_probe(struct platform_device *pdev) } else if (error == -EPROBE_DEFER) { goto err; } else { - dev_err(&pdev->dev, "Failed to get regulator\n"); + dev_err(dev, "Failed to get regulator\n"); goto err; } } mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hcd->regs = devm_ioremap_resource(&pdev->dev, mem); + hcd->regs = devm_ioremap_resource(dev, mem); if (IS_ERR(hcd->regs)) { error = PTR_ERR(hcd->regs); goto err;