From patchwork Sun Jan 12 13:46:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13936408 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BD1DE77188 for ; Sun, 12 Jan 2025 13:46:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7360110E260; Sun, 12 Jan 2025 13:46:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gGwWNSLY"; dkim-atps=neutral Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65AF510E260 for ; Sun, 12 Jan 2025 13:46:40 +0000 (UTC) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5d3c1f68f1bso506798a12.3 for ; Sun, 12 Jan 2025 05:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736689599; x=1737294399; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vdPpMH3EB/gIvZxidNjtZ/XKsVJM/FqerzgsImOH6b0=; b=gGwWNSLYSII5bNTWz5Ncg3L4aDYOldNesOHBfV4Xdbran0jzRSWOuXpmY8ReXbHLJ2 WLlc/m6s9OmYGwgibbcv6qQTtAAaI4e7p818qTR+Tm8W84UCfrez4O51EgXh8ZJ1poBy m7MUb9dumI9LKMSbpQqkPXXy+COv23+2Pzih60C4GuQPH6RX1UKx3xqc6QG1U+zmy1OM 1prRkveqffwAMjQ/KMiSWSYrVfTmBpGlzj8BXA0OWPmoo3bpa/ql3dOlNbH68e2ygKfo wGBcK5mhhPGK6mz+Vb+HXelBihO9WRJ7p7qWEMsN7gT+5Xcon39jXwQRe/iRG7bvr4+g 4UHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736689599; x=1737294399; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vdPpMH3EB/gIvZxidNjtZ/XKsVJM/FqerzgsImOH6b0=; b=Uya1l9aqaNAPNRUy+BJWaKV+Xk4sv5AqSncI7LYn4FKBL98CujgfWfccBcQfNsQ99k cXyRHlwuNVMov8P2qQBMcnNDWQwA47z48oaxjvMluYOQ3RwftLUweKtOqLez4KHFy1fm tz00LKaNBKZTHkVEYJZW8/tkldcLzJDPFXGocC3VBy7tVl6R7kv+D6/74r5peUhcMgPB O3u37G6SPab3HS4KP0PuOMwLgvQeFtBdFNf+QsdhX448Tyybhk2Ig/7XNkIIji/u8/Sn zGdtTKq9Q+aAIBgZ5P7y1OiMJaKv+JS1jCcEXmWSBrAxcAgBcJYTpJrZc3vQ5vX/kr4m nCpg== X-Forwarded-Encrypted: i=1; AJvYcCUwUJptVIIkemXk6ynWAADXnhKcnw2HRDb4wFM78TD3MUJ70rY118QTfomd2Y9wE/tpOsNSVxsXqmg=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzaoae01Bb3NiA6b4NZmILiGtLJy1+0HvXzvjKfNTWMcTyipAcO 405+RVIxSNc4QyoBxSOcfbWiVkqnTJ5PCPwjeJI5G0H/TPH/xDgGqp7Lwjz8OwI= X-Gm-Gg: ASbGncu3x9g7Obn9TflGteb3Upz5EcFtAXiWLg+t5mkA44OFla2f8fRBu6H6x/clXdh O8APOe30oaMt7d9m+o2EsTLUA42cJKejV2py3nyUShlMK/0dy+Xr9ml4ozbBsVbw9auXajo3Tts E5Jd9IADKMUcMlgVBsuWwE+BkAYu4rbBIbY2zJ2Fus+peGobzk7da7xZDsqoZMD7KGb0nY29akn zS8U/H9O+BacueNUcf3W24ySUQx+JHzM41rFE0jqgCRuK9I8V43BypPuuMS5aYOAay5LDI= X-Google-Smtp-Source: AGHT+IGMaMySK+AzczYWaado8bQXerWOI16nG+e9W1R3XECS4GCbYRudIN5tZNNHFbXoJHhLI8HzVg== X-Received: by 2002:a17:907:1b05:b0:aa5:3e81:5abc with SMTP id a640c23a62f3a-ab2ab643defmr680650766b.1.1736689598955; Sun, 12 Jan 2025 05:46:38 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90638acsm371051266b.20.2025.01.12.05.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 05:46:38 -0800 (PST) From: Krzysztof Kozlowski To: Helge Deller , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski Subject: [PATCH 1/2] fbdev: omapfb: Use of_property_present() to test existence of DT property Date: Sun, 12 Jan 2025 14:46:33 +0100 Message-ID: <20250112134634.45991-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" of_property_read_bool() should be used only on boolean properties. Cc: Rob Herring Signed-off-by: Krzysztof Kozlowski --- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index c3329c8b4c16..7010544e02e1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -3933,7 +3933,7 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) return -ENODEV; } - if (np && of_property_read_bool(np, "syscon-pol")) { + if (np && of_property_present(np, "syscon-pol")) { dispc.syscon_pol = syscon_regmap_lookup_by_phandle(np, "syscon-pol"); if (IS_ERR(dispc.syscon_pol)) { dev_err(&pdev->dev, "failed to get syscon-pol regmap\n"); From patchwork Sun Jan 12 13:46:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13936409 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FC2EE77188 for ; Sun, 12 Jan 2025 13:46:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76CF510E2E7; Sun, 12 Jan 2025 13:46:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bu/JLvtI"; dkim-atps=neutral Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAAE710E2E7 for ; Sun, 12 Jan 2025 13:46:41 +0000 (UTC) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5d3be7f663cso645115a12.2 for ; Sun, 12 Jan 2025 05:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736689600; x=1737294400; darn=lists.freedesktop.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=17mfEUKLFobncZ1DtZDYZ0xDKM3wSv4g9CH5hL4TNJo=; b=bu/JLvtIgX7e/K2iw0ZUkgCiJtQMZYwT2Tc4kdGVK5UUZd5NzAt7RcpQNKDH9IlAw5 phR1vjQ+BxfpkgiQ5lsyMXDBxMvi3sWyAunJ3GfNzhVpZmK2Aow9bqyfbB2F0DRWzGjf yI/kasfaUp1uoncZ75tEGmE7qRxkzgebkP0Aa2FajgeqmDiTnm9YrnF0b2v64TavOD86 eg5xxT4OsYzsIePD37Rl5XcAjJXFMqXbg8jm7SkYmMlwN1rH4s2qxNn9yy3SwZ0bx15h dbOY61IGIVowkmOxCdgwSZxs466wt3nuEVvCkE3B0Jq221quLhcsg3R+nK2N0/eFqWF6 QvoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736689600; x=1737294400; 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=17mfEUKLFobncZ1DtZDYZ0xDKM3wSv4g9CH5hL4TNJo=; b=GSyvwwaxdtMvlBaseVikLGILu0tfTjH65AkWvVBLgz4kFCwk/+YzpYYudhDxeLFiij FqpgVbAg7P66dCI7E0BXftDuLaGthhHVFuHxcGKOk9jwso0Avz9ThG1NbAJboeo21nOg B/f+AMRWu4ezML+hth+ve8Ar2/sCxtBbd1NWoEEyaQ1+xe6Cy+vX+vmOAJTOHPEf6oxm ds4nBvJt2bWCYofZTgH4/RmWb5ZIQROzAIXUrx1JAQgrcapAMqdhZKMRPeoIA8NdFdA3 AHtIMnFYH23SNfozrh1A30EgRvkGkCbAH8bWtxOR1qHcdRtATBgYZKHWWBURzBS/tJS7 tlbA== X-Forwarded-Encrypted: i=1; AJvYcCW6RZBoReVhTRGoJsOuYRc3yqnf7R6yc7c9T8bkbDcz5IEhgBRofPby1KKlxX7xlXunt3/+qf5naow=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx8kaChW+E50aQ7igkcU89Y+TMLD/x1Y7l9IS00Ca5z5swDGz2h jUEncFJkXButOkNmNIL8Qv6Il96XmdUQfW9FYaNMvHfjopOkTjPoOmbrqzc9G/E= X-Gm-Gg: ASbGncssYDt+GWYlmK43OJccj5muBnsy6ZcnOBq38k2Slu1So8X7GWH4XbYim28Q1Vf UAQPJScJeuULd2JZPfT2PYuzwctsRFYH/fQGHg5t4oqz98Plkiqz5xxGBAY7r7Jrnwz4LX+LvBl xLngpH9AdqHs5ejfP4LSrbHxpaxbq1IpDivkoXeWwsBclqRgBOvGKQ8oYzHzpekpUag+kmNg29F cRCkJ8ojq7ppWrB303W0TSdKuzFVOawJJ2ZMGWU1HEd6SDYyb3pQS7U6g5SHi2codR/ikU= X-Google-Smtp-Source: AGHT+IGek+mcaMq6Bx12/YzpJyPJOeOrjQQOfVQjcgfD7uU+pEIuD+vivjLmYHe/XC44J0Mh/I2d6g== X-Received: by 2002:a17:907:6d20:b0:aa5:46ee:9545 with SMTP id a640c23a62f3a-ab2ab571e20mr567188866b.5.1736689600270; Sun, 12 Jan 2025 05:46:40 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90638acsm371051266b.20.2025.01.12.05.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 05:46:39 -0800 (PST) From: Krzysztof Kozlowski To: Helge Deller , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski Subject: [PATCH 2/2] fbdev: omapfb: Use syscon_regmap_lookup_by_phandle_args Date: Sun, 12 Jan 2025 14:46:34 +0100 Message-ID: <20250112134634.45991-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250112134634.45991-1-krzysztof.kozlowski@linaro.org> References: <20250112134634.45991-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Signed-off-by: Krzysztof Kozlowski --- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index 7010544e02e1..ccb96a5be07e 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -3934,17 +3934,12 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) } if (np && of_property_present(np, "syscon-pol")) { - dispc.syscon_pol = syscon_regmap_lookup_by_phandle(np, "syscon-pol"); + dispc.syscon_pol = syscon_regmap_lookup_by_phandle_args(np, "syscon-pol", + 1, &dispc.syscon_pol_offset); if (IS_ERR(dispc.syscon_pol)) { dev_err(&pdev->dev, "failed to get syscon-pol regmap\n"); return PTR_ERR(dispc.syscon_pol); } - - if (of_property_read_u32_index(np, "syscon-pol", 1, - &dispc.syscon_pol_offset)) { - dev_err(&pdev->dev, "failed to get syscon-pol offset\n"); - return -EINVAL; - } } pm_runtime_enable(&pdev->dev);