Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4013202ybd; Tue, 25 Jun 2019 12:26:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH6uHdNMTtu9sUtFImJ7iOHrI+6uAYlGBtsWaQNQQLBPZifxg+BcCNUvdoyT4I2tBPt4Mz X-Received: by 2002:a17:902:868f:: with SMTP id g15mr343132plo.67.1561490777483; Tue, 25 Jun 2019 12:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490777; cv=none; d=google.com; s=arc-20160816; b=Me8JFhSSaFZHA3bzcCK+pL1CiAXuX2YUplO+wcDs4WzQY4qzbuYLbzKKISv6VGjMA8 ZDCDey2cNXA+UTfhmGpcMIH8lldA1WzRkHuVqd73IrKZRrKJ3tcInAFnMwEUVYHqaf7p yKZ6kEcBNaZtkjchGayVsuslh+n2ITyPLDBPxVYpNH7nIkUjm/cGzy9flhEJcd6vX4Iq FbX6Ft2S3G37KEN9u4y1H7HHbkmh6+KKrsQmScwLX/mpFgdjBzLqiITkSsZfhkM3dfaV thgSNHl63sef2ki24L/eNSrIzDgr2jyCGEzGD6PAbQ1eZgkIMOwhMfFdyQb+gmjJBQYy 5Rgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8iezztZquUE7VOJu2VvhRUb2IfrZ8cIwgoI4gm0DrkM=; b=hLf+krqoUuJqPgLGp8sU0SpmBZMqNHozRYPCapmrSCnBoqShZ15v4JK62eh4qOhFAC 8vISunQCz6q2sqdSccI5i2LgiF8H3RjSTso9SZKMP3fJVDPGXMCjZSVNqGdUmNeeJdi9 DSDfnGbaJosL/IRzCeDDjMhY7E2wKp13HhnIaRYCUl6OlFpuy4ckA8LYVvREofCxaGuL yKf08C4RqBuwmLDbuzmokLZvtRRNYT8Rkrl7KFxdijODh+kNsv9MO4cW9YnBN5bDTh1o GI91cJoFeFPeDSdA6sSxb869l4d22JoJCh62Gm1HyjQxUE4/y2zhosl8GcJ7KSYFe2GS WR3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rgxXlRAa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si972611plz.109.2019.06.25.12.26.01; Tue, 25 Jun 2019 12:26:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rgxXlRAa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730064AbfFYQe6 (ORCPT + 99 others); Tue, 25 Jun 2019 12:34:58 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34357 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbfFYQe4 (ORCPT ); Tue, 25 Jun 2019 12:34:56 -0400 Received: by mail-wr1-f67.google.com with SMTP id k11so18662752wrl.1 for ; Tue, 25 Jun 2019 09:34:54 -0700 (PDT) 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=8iezztZquUE7VOJu2VvhRUb2IfrZ8cIwgoI4gm0DrkM=; b=rgxXlRAaV6xZXnZFHal/gjCfi7ThDBTYi4zQlerr90dKuypsYo0mb+p33lydeL4eKn 2Cg8TDpnk1TQyWRPgE7auXmAdnsrV7xq0CkHwBoS14Z8stdjg5sO1sgEu4CXM0obe8GT HtDtgDT/yuWJ/6FSenaU3s3kQIgEWAOjiCDWUhU8Pfhoj3WCpQG547MgKdHM7a0QE2ml oMYIbV67RK1VeetSwtj5yG0Sb0iifz24h/amsfYK1tn89rbBjiyJy6Dq7HfJ6k7U1O2X NjWCVLOG8O2PA2zG7LLOXV9LLX5jw93wHA6dgCylVM+dJAI+sj7QPNmJX6O7U4MR7nGO 8GcQ== 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=8iezztZquUE7VOJu2VvhRUb2IfrZ8cIwgoI4gm0DrkM=; b=uFNxwlozesrI6PuG6giqfSdO68GdNnTZqi+8C1yeC/Y0Q0GXb3tm4ULNo4Wqh8mzrB x9/Te+6Fy0oHK3GW+H8CO+NNuFCULx7YN5Ng++U8Hox0dH8UCgiqphiVd4n005L0+wPG hIuNJlJhpOS5h1aECRvnCRk1D6Tt4vmd+hIPFNI8BwbHdILC7gI5DM34ADYTFIt1s7dp bpNIzfU3QjPPGUmlUoMvP6PGyDu/sPABViRuAypbwS1gJTSSyNTHr1PCObbWsr3f8JbY pyAfHy8fqZUsmHlNAg+VKAaEpd11to7uFZBbVGAxmiU7W7Cxp+H8ogxhTb3t8BKQqBGv mlrw== X-Gm-Message-State: APjAAAV1lO5u8J2cs6rFqq+4lWIlOss2yNEFUlJ2bByyPB/FQNE15nDz DAb7qxEjnp9fQYWe+zmo+NDjDw== X-Received: by 2002:adf:81c8:: with SMTP id 66mr110996508wra.261.1561480494146; Tue, 25 Jun 2019 09:34:54 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id g8sm2683795wme.20.2019.06.25.09.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 09:34:53 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , David Lechner , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 02/12] backlight: gpio: use a helper variable for &pdev->dev Date: Tue, 25 Jun 2019 18:34:24 +0200 Message-Id: <20190625163434.13620-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625163434.13620-1-brgl@bgdev.pl> References: <20190625163434.13620-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Instead of dereferencing pdev each time, use a helper variable for the associated device pointer. Signed-off-by: Bartosz Golaszewski --- drivers/video/backlight/gpio_backlight.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 654c19d3a81d..8adbc8d75097 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -83,15 +83,16 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct gpio_backlight_platform_data *pdata = dev_get_platdata(&pdev->dev); struct backlight_properties props; + struct device *dev = &pdev->dev; struct backlight_device *bl; struct gpio_backlight *gbl; int ret; - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; - gbl->dev = &pdev->dev; + gbl->dev = dev; if (pdata) { /* @@ -108,7 +109,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, pdata ? pdata->name : "backlight"); if (ret < 0) { - dev_err(&pdev->dev, "unable to request GPIO\n"); + dev_err(dev, "unable to request GPIO\n"); return ret; } gbl->gpiod = gpio_to_desc(pdata->gpio); @@ -123,11 +124,10 @@ static int gpio_backlight_probe(struct platform_device *pdev) memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.max_brightness = 1; - bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev), - &pdev->dev, gbl, &gpio_backlight_ops, - &props); + bl = devm_backlight_device_register(dev, dev_name(dev), dev, gbl, + &gpio_backlight_ops, &props); if (IS_ERR(bl)) { - dev_err(&pdev->dev, "failed to register backlight\n"); + dev_err(dev, "failed to register backlight\n"); return PTR_ERR(bl); } -- 2.21.0