From patchwork Thu Jan 19 21:39:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Lambe Jr X-Patchwork-Id: 644315 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 4B4D7C6379F for ; Thu, 19 Jan 2023 22:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjASWBt (ORCPT ); Thu, 19 Jan 2023 17:01:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjASWBL (ORCPT ); Thu, 19 Jan 2023 17:01:11 -0500 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E77259E41 for ; Thu, 19 Jan 2023 13:39:36 -0800 (PST) Received: by mail-qv1-xf2e.google.com with SMTP id u20so2471659qvq.4 for ; Thu, 19 Jan 2023 13:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sparkcharge.io; s=google; 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=LV9OZ3zFtkDLpf/Q73kAo3k3wQt+efvU2HfxDW5J4xU=; b=kz0ICmRjeaxis1CYzfaXRho4F72emDWp9/L3clEhmPqjdhbGbB5XIeMKlYo9btykB3 zGzlOVNVou7LgZyhrrgR0ZHyr9lVCkwtFbqGxa6kKdDdTWPYdpnFT2YhpsG2LiW/FOAq WZd5mS8N2eaC+pQ4qcUiWy9CMd6Jq5apRPRSr81Mzasf138XZil/KWNqR592FiNr40iM nsIgSVI1CLl6sEXJk+XnOvX+MsiSGDYouaR1WwAj5U5xNYzTeK0dOt1mzQgMv3jT5KCM MJKGSLu5j1Fo1FsGUP2KK6PODs+RdS6Fmmi205mXcwZTx2JwcQhHM8iu5SbenaD/BduX UO9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LV9OZ3zFtkDLpf/Q73kAo3k3wQt+efvU2HfxDW5J4xU=; b=R8VNcebRh9/zuxjNGrL3p+o07xleS3LCBxaG5zY7xOPmWdC8WsFPjxYQ8y6XxY7Thp p0IqAoX1M8zBdQ6juuPq4saxF2C1s08365Vz4ATQsvaL/5GZ1Q3tx/OaxxHDZYoOxXDw QCholDEM0PMZ8gxHn86749JOhLI1QAIEiMlSv7AD1sadlAIN8bAzjkiEKif9Lhw+Iu31 E/pRFwUkjBv3hEa4+lU5tQoe7BmJBleUt8kM0qmTFjF+cB4LTqLJS/t3l08H8fchBTgB 0Fvs43GZqZf5wMKWl66Dg0Mes+Jd7jwTbt6JfQARH4zgcTiEzFoqRurl9TBah/YZS5ap bFTg== X-Gm-Message-State: AFqh2kq5KzkymaKcdnvSz7jLYY1/IUdSfjasTl5eW6GDmcZB56G+zfKg Cr2Zk9LfhXbwEiBHqEVgtcGWUw== X-Google-Smtp-Source: AMrXdXtb5Ys7U4vEwZn2MJGVTLV/Z41jZFry7umz0eWRnZoQ4kwzNYiVTdYkHv2tq+ujtfAqvxVwLw== X-Received: by 2002:a05:6214:5d8d:b0:531:e636:e236 with SMTP id mf13-20020a0562145d8d00b00531e636e236mr16867754qvb.28.1674164371726; Thu, 19 Jan 2023 13:39:31 -0800 (PST) Received: from localhost.localdomain (c-66-31-16-167.hsd1.ma.comcast.net. [66.31.16.167]) by smtp.gmail.com with ESMTPSA id l13-20020a05620a28cd00b0070531c5d655sm2600676qkp.90.2023.01.19.13.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 13:39:31 -0800 (PST) From: Dennis Lambe Jr To: Alessandro Zummo , Alexandre Belloni , Krzysztof Kozlowski , Rob Herring , Atsushi Nemoto Cc: =?utf-8?q?Myl=C3=A8ne_Josserand?= , Gary Bisson , Javier Martinez Canillas , Troy Kisky , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Dennis Lambe Jr Subject: [PATCH v3 1/3] rtc: m41t80: probe: use IS_ENABLED for CONFIG_OF Date: Thu, 19 Jan 2023 21:39:01 +0000 Message-Id: <20230119213903.899756-2-dennis@sparkcharge.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230119213903.899756-1-dennis@sparkcharge.io> References: <20230119213903.899756-1-dennis@sparkcharge.io> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The style guide recommends IS_ENABLED rather than ifdef for wrapping conditional code wherever possible. Functions that are only called on DeviceTree platforms would otherwise need to be cluttered up with __maybe_unused, which is especially undesirable if there's nothing inherently DT-specific about those functions. Signed-off-by: Dennis Lambe Jr --- Notes: v1 -> v2: spelling fix in changelog drivers/rtc/rtc-m41t80.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 494052dbd39f..f963b76e5fc0 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -909,10 +909,11 @@ static int m41t80_probe(struct i2c_client *client) if (IS_ERR(m41t80_data->rtc)) return PTR_ERR(m41t80_data->rtc); -#ifdef CONFIG_OF - wakeup_source = of_property_read_bool(client->dev.of_node, - "wakeup-source"); -#endif + if (IS_ENABLED(CONFIG_OF)) { + wakeup_source = of_property_read_bool(client->dev.of_node, + "wakeup-source"); + } + if (client->irq > 0) { rc = devm_request_threaded_irq(&client->dev, client->irq, NULL, m41t80_handle_irq,