From patchwork Tue Feb 5 10:25:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10797251 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 B2B7913BF for ; Tue, 5 Feb 2019 10:26:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1DB32B5E6 for ; Tue, 5 Feb 2019 10:26:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95BD32B613; Tue, 5 Feb 2019 10:26:38 +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 8B5122B5F8 for ; Tue, 5 Feb 2019 10:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729131AbfBEKZ4 (ORCPT ); Tue, 5 Feb 2019 05:25:56 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53924 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729089AbfBEKZz (ORCPT ); Tue, 5 Feb 2019 05:25:55 -0500 Received: by mail-wm1-f66.google.com with SMTP id d15so2976534wmb.3 for ; Tue, 05 Feb 2019 02:25:53 -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=K28XEDucrkZ5vgvjZiASy101nZ1AxRRv73xLLYx8KTo=; b=ekRvCqVm+xtU74RrKwAd41IXAQxFSUFWlIaLg+6J5y6MeIV8O0g8TlaAW2Eov0XQQm y/HjVMN0gITr/hb4ExYPvvq1spFo7qSblVl89fVAdjiaXYZOHZ2biaQ2mCmHDlUCJMKO ziNuBragCMqI+Ly6/ni8rdUm3AUkiSm2YaHwJGzSrzyaoI1yqR1mAalt0oQH36iIXWz1 5t4awRrARZsiUJLbULx47sKoVI+hwQMwH0+C+BtKRaLfhP8auKY0BWqv9Y8UgKlcnSGT hgAwAzx4ES6MbvLyHyYJuYlXIHWEuqfWdOvWUuzE+ZFVFUiYX/U58UGXWV5pjxwNZk1r 5Bow== 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=K28XEDucrkZ5vgvjZiASy101nZ1AxRRv73xLLYx8KTo=; b=EM90CJ15mqTqoSqIOuhBR2hqdtLZ1fcDj1niwgMlinPmYOnmUfiFowIGmBFJI4LGgJ IdWX1xhuSpJxdt1toIh0wEMZ96I2bPhG0+U1oE3OyuLxhrAaoI6+FM7Hs/FaXJfnB/aQ omCA2jVpmUyO1rH0kGWwwCKAfgLVTjH/CtRLITAgRFmlIyg2espqwX8hgY665THzSb5N M+znHFflATjKQwjTs9qvIeD9Tv1xVarGgUqGd7Gj0kNj3T+syy5FdpEMkWGmnX0RkjyA 0Ij6fHNG113kUQO4u6ARt0YiTdq3JmfsneZMf7gGUI7971X3ipVw6uiHMVQnoXMxUFJe 2gOg== X-Gm-Message-State: AHQUAuZWaJawvD6IVwy4HKvNeqYt10FYOZMwdAo/Dulqtm7wj8bPRVHp avXRvXvmd68a1Dr9/VzbkK8tNA== X-Google-Smtp-Source: AHgI3Ib4vgR76sqHah7iOtB1dwjhpJLu9RRaSYtef1Gl8/yjMFKLzYEFWOGmumqju+OJB5OeNt9X9A== X-Received: by 2002:a7b:c5d1:: with SMTP id n17mr3113741wmk.152.1549362352910; Tue, 05 Feb 2019 02:25:52 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id r11sm5132396wrx.75.2019.02.05.02.25.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 02:25:52 -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 2/8] usb: ohci-da8xx: add a helper pointer to &pdev->dev Date: Tue, 5 Feb 2019 11:25:40 +0100 Message-Id: <20190205102546.29457-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190205102546.29457-1-brgl@bgdev.pl> References: <20190205102546.29457-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 This improves readability by removing all the &pdev->dev dereferencing. Signed-off-by: Bartosz Golaszewski --- 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;