From patchwork Fri Sep 1 12:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 719603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CCF9CA0FE1 for ; Fri, 1 Sep 2023 12:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349328AbjIAMBL (ORCPT ); Fri, 1 Sep 2023 08:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349321AbjIAMBI (ORCPT ); Fri, 1 Sep 2023 08:01:08 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190BC10EB for ; Fri, 1 Sep 2023 05:01:03 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9a5e1812378so227404166b.2 for ; Fri, 01 Sep 2023 05:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693569661; x=1694174461; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3Q8dcqWIi8qfe4rFjMBwnA3MXBS8IlDgEZlXPHxdDbc=; b=f8Cn8PhEmbugxXX8cp1rtapLm/lwjUWOyM87Jft36Svsf+RM3R1a8pYFAziRaNv9nO FtKbTm2RDVtBwUSc28HRCgn+DMOntkl2uJnIFb/FPDhgfqGgrwfFz8kgivSxuSr9cQRF VrQEY4skRoTTtcstIHaAo6ynysdYbCljdgou9VR5CJbvgKEgnkuyhG4qhH3Y3JH6UR2y 4eGI2tOytw8bfwMQoKxfswDn+C8u49g7in/PakdtoNXsfbSMpGI/QStuXDrsGJeByL99 APCQDZ9s7zvhWrYUqLwJX337AXRaBTmwdvjDufLYMdj+yRdkwIB5UmlM/X8+ZnJhpPwS KTBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693569661; x=1694174461; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Q8dcqWIi8qfe4rFjMBwnA3MXBS8IlDgEZlXPHxdDbc=; b=P/YC0NwqFwgnn4Z1eUatFQuRUa2Cr70A7k2b1Ie21ej5/p+Yb8lURObFcJwy4P5YZn yfBuBR12wI/kPWuIBQKyp5aSUydsNyw5ymnJg8jP9bl23tDRyz/d9Z+PwX61sw6E224r tMI+3qEvZ/0u2fewl84bSKNjhGvuSqTIXt5HQ6kbE9xSl2Ixw9QSCgByow3HcUrlMEcF DofJ8ETefakh5oPrjAjIe8gQK+aXpk1l1QL1lTdOpOp7w/hWLGGqO/puzdO6zz6Oqp3s JsPknJy6LY95FKakaoEbpk11VfEQHp/HJKaj40pu6uczlfguI1k4F27ARp+E8WMWLXVt uZDQ== X-Gm-Message-State: AOJu0YxIpjRMR+YQDQWTbMmA7FDLYFDyDe+Utwd8Oh+7L+7bmTP2j15u R5y1ZC+2lyXyZNxcMp2vXJgGDw== X-Google-Smtp-Source: AGHT+IFO69PhfApiWoJ10ALX5LCVOgGWPETEhTDqrXyG9F36Yfc1fiNItFAnBKhYo0wBJNtMIHfaag== X-Received: by 2002:a17:907:7608:b0:99c:c50f:7fb4 with SMTP id jx8-20020a170907760800b0099cc50f7fb4mr1581342ejc.1.1693569661575; Fri, 01 Sep 2023 05:01:01 -0700 (PDT) Received: from krzk-bin.. (77-252-46-238.static.ip.netia.com.pl. [77.252.46.238]) by smtp.gmail.com with ESMTPSA id kg12-20020a17090776ec00b00993928e4d1bsm1877343ejc.24.2023.09.01.05.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 05:01:01 -0700 (PDT) From: Krzysztof Kozlowski To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/3] power: reset: syscon-poweroff: simplify pdev->dev usage Date: Fri, 1 Sep 2023 14:00:56 +0200 Message-Id: <20230901120057.47018-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230901120057.47018-1-krzysztof.kozlowski@linaro.org> References: <20230901120057.47018-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Make the probe() code a bit simpler and shorter by storing all the '&pdev->dev' as 'dev'. Signed-off-by: Krzysztof Kozlowski --- drivers/power/reset/syscon-poweroff.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/power/reset/syscon-poweroff.c b/drivers/power/reset/syscon-poweroff.c index 430d440d55c6..11b955983279 100644 --- a/drivers/power/reset/syscon-poweroff.c +++ b/drivers/power/reset/syscon-poweroff.c @@ -32,23 +32,24 @@ static void syscon_poweroff(void) static int syscon_poweroff_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; int mask_err, value_err; - map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "regmap"); + map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap"); if (IS_ERR(map)) { - dev_err(&pdev->dev, "unable to get syscon"); + dev_err(dev, "unable to get syscon"); return PTR_ERR(map); } - if (of_property_read_u32(pdev->dev.of_node, "offset", &offset)) { - dev_err(&pdev->dev, "unable to read 'offset'"); + if (of_property_read_u32(dev->of_node, "offset", &offset)) { + dev_err(dev, "unable to read 'offset'"); return -EINVAL; } - value_err = of_property_read_u32(pdev->dev.of_node, "value", &value); - mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &mask); + value_err = of_property_read_u32(dev->of_node, "value", &value); + mask_err = of_property_read_u32(dev->of_node, "mask", &mask); if (value_err && mask_err) { - dev_err(&pdev->dev, "unable to read 'value' and 'mask'"); + dev_err(dev, "unable to read 'value' and 'mask'"); return -EINVAL; } @@ -62,7 +63,7 @@ static int syscon_poweroff_probe(struct platform_device *pdev) } if (pm_power_off) { - dev_err(&pdev->dev, "pm_power_off already claimed for %ps", + dev_err(dev, "pm_power_off already claimed for %ps", pm_power_off); return -EBUSY; }