Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp753736pxk; Thu, 17 Sep 2020 15:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUuwEX8luoY9sXu2bF+G438KAxbcBkYApmFGFQvlYauFMz6vd+jH2Pa3icBmpnYszmVjhh X-Received: by 2002:a05:6402:1773:: with SMTP id da19mr34237249edb.171.1600382189465; Thu, 17 Sep 2020 15:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600382189; cv=none; d=google.com; s=arc-20160816; b=UIcxkxNCUUcRSfmWMc6vpvnbC5oITRFeLJF0Wk9vm1eusp+n1FdobSTKjCp74RR6ec NdK93lEUB+1FVg4GQY5bIQjNEvDGJqYELksf147oUs7rPO8cgD6Vmd9IS8Yc5o5c/X3t Oklv8vMmsE9KNdGz1cQfEHxnxWfLyEsbCC6IGAfK70JwixTVBlv+XyGdtLLZo4+PxoJ6 K9W81e7KRABJ56/+r0MVBFYiE605YD7uyYZ8QaT3M3RwcmXZ1cztOOH0f092ty7wRgVB ioEPoS7xf3VOdhR93Nuvp558WmWE+vN4xLFl4gQMh/JYLyR+P4BnUo9megKTyPOIUdGi eTWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rSK8xm0Ik8DPFYBi0usqAIGbLf15ZZbi/xiunWDg2pQ=; b=zb+n07e941QflOI9o/HaL3iT1+tuTIpzyPxvt6uK3Drn8UuQrw7FGBBmrIpE6Wr2FL /uIh+CkvT/05LrMo6/jAb7XCxgZR3CVB7CuRKSi6+OP6pSktk6u0TYdNFZf64LT2fKW3 6utzZJat6RH4foTX2CjzjDwm0okfzCu+XDPmyr/uuo1NWN4HTmmU3WkjOPjJUOL3LuY7 AmriZeC+izQ2mxouY6sZhnIBRMxcCLcUhiYJzipXznGrx0x52Yb1CjPg8ToF44gblz+I 4isf3Yt+dNtJFjN0G1YerXwdFiNKZW3W4taHMJWzD2T/ceI8IRULDhZW2Jdko1hjV3FC Shpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=tmtTVYUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si951489edx.274.2020.09.17.15.36.06; Thu, 17 Sep 2020 15:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=tmtTVYUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgIQWep (ORCPT + 99 others); Thu, 17 Sep 2020 18:34:45 -0400 Received: from mail.nic.cz ([217.31.204.67]:35842 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbgIQWeS (ORCPT ); Thu, 17 Sep 2020 18:34:18 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 88985142066; Fri, 18 Sep 2020 00:34:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1600382041; bh=KyoQbN7zEtG1uv+Pu41Y0V6Z7eh7NxeLV28us6kXmE8=; h=From:To:Date; b=tmtTVYUaZxj57qHSwsrDrCOHMwRCTfX6m4ST8tOxjUYS8FNAqPlKj97GPxK+WxHSF 44alVESairypb+d5e1dSTnrJVYKkRKp4c08WGUiLPvlu2jOtpNkAmiOdPEVH55YcK1 1F6H74x3SSJ8VoRGaKk8qOBNB4ufuYsUmbHeo8bE= From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: linux-leds@vger.kernel.org Cc: Pavel Machek , Dan Murphy , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Simon Guinot , Simon Guinot , Vincent Donnefort , Thomas Petazzoni , Linus Walleij Subject: [PATCH leds v2 44/50] leds: ns2: cosmetic change: use helper variable Date: Fri, 18 Sep 2020 00:33:32 +0200 Message-Id: <20200917223338.14164-45-marek.behun@nic.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200917223338.14164-1-marek.behun@nic.cz> References: <20200917223338.14164-1-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Spam-Status: No, score=0.00 X-Spamd-Bar: / X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use helper variable dev instead of always writing &pdev->dev. Signed-off-by: Marek BehĂșn Cc: Simon Guinot Cc: Simon Guinot Cc: Vincent Donnefort Cc: Thomas Petazzoni Cc: Linus Walleij --- drivers/leds/leds-ns2.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 912db40c51183..801b7f851be7a 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -185,7 +185,7 @@ static struct attribute *ns2_led_attrs[] = { ATTRIBUTE_GROUPS(ns2_led); static int -create_ns2_led(struct platform_device *pdev, struct ns2_led *led, +create_ns2_led(struct device *dev, struct ns2_led *led, const struct ns2_led_of_one *template) { int ret; @@ -216,7 +216,7 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led *led, led->sata = (mode == NS_V2_LED_SATA) ? 1 : 0; led->cdev.brightness = (mode == NS_V2_LED_OFF) ? LED_OFF : LED_FULL; - return devm_led_classdev_register(&pdev->dev, &led->cdev); + return devm_led_classdev_register(dev, &led->cdev); } static int ns2_leds_parse_one(struct device *dev, struct device_node *np, @@ -313,28 +313,27 @@ MODULE_DEVICE_TABLE(of, of_ns2_leds_match); static int ns2_led_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct ns2_led_of *ofdata; struct ns2_led *leds; int i; int ret; - ofdata = devm_kzalloc(&pdev->dev, sizeof(struct ns2_led_of), - GFP_KERNEL); + ofdata = devm_kzalloc(dev, sizeof(struct ns2_led_of), GFP_KERNEL); if (!ofdata) return -ENOMEM; - ret = ns2_leds_parse_of(&pdev->dev, ofdata); + ret = ns2_leds_parse_of(dev, ofdata); if (ret) return ret; - leds = devm_kzalloc(&pdev->dev, array_size(sizeof(*leds), - ofdata->num_leds), + leds = devm_kzalloc(dev, array_size(sizeof(*leds), ofdata->num_leds), GFP_KERNEL); if (!leds) return -ENOMEM; for (i = 0; i < ofdata->num_leds; i++) { - ret = create_ns2_led(pdev, &leds[i], &ofdata->leds[i]); + ret = create_ns2_led(dev, &leds[i], &ofdata->leds[i]); if (ret < 0) return ret; } -- 2.26.2