Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2980460rwj; Mon, 19 Dec 2022 11:14:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf6xKd7GmhmryqOsUNw3bwXhpjfTq/DrkX+PWNaokxs73KwhFddnebo/oudejZ1uNPMU0VhZ X-Received: by 2002:a05:6a21:9212:b0:a3:2244:1d2d with SMTP id tl18-20020a056a21921200b000a322441d2dmr54167453pzb.52.1671477264469; Mon, 19 Dec 2022 11:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671477264; cv=none; d=google.com; s=arc-20160816; b=JsTI1ip9ncuuUDOajFpfZqBvwvccVPmz8hOzSvC+U+mdMUZMmPi2w7ZT6zuFgX3nKv xkyApG09pZPAtcZxX2NXSoTmPe1uqDm8+Dkzu5MbFiKrrqk9K9pfEZhwlZTjSxHPJS9+ Osnykh0iaZsPr+qrX7D0Ga0hsdDI3B+VEEwArImiWB9S0KfB3C3VGggntdyjf84TWiBz TRYMpuy55xb2FPLnAktksAOp+/QHT0FHhvc4lAwEuGC6P5mq10uqaJQIXq8WhymbRLDp eEZPqmO6Bpy9aaDKRCkRKvpQrVcaikfbr4EPtUg/6htaVTrvw/3IqfYLjsP5NTjMDSbA CDJA== 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=F/CCMZCQj5dF++B+69iBkvBLnhcDqwiWIOUWa6+GvPo=; b=SsIDVwRphC/Fl2TvQxygsO71eTOVvpzxL5Y1e09X/o76PabXf5/kZwKvOXpBOzMvx+ +sB73ZLpIu64h5NFpvnp0GPFP+YrmyjgfO7l22eDT+9VzbYV3jSl5VUfuy5qC3YxnUQT QeBEP4RC772tzE3RLs6Mg+7eVyaY91JoDKc153jQfMJTSrRQ6SWr4vx83ep4Yw9BqPyb e++5kdhLcTlbBL1YNX0vFzEu5UpwUW5hWE8FDnUmhaaU4eKBPCnayumrAlLTm1A6DRXE 4zA0DMpCtlBI/Gs3PFy+0B7L8QGx3cob55FzcfWaLdoBTdFKdL1pT8bJN8gv9ZWD+JgV bqvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@sparkcharge.io header.s=google header.b=fPnsy+VG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b129-20020a633487000000b0043941e5532dsi11700789pga.391.2022.12.19.11.14.14; Mon, 19 Dec 2022 11:14:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@sparkcharge.io header.s=google header.b=fPnsy+VG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231931AbiLSTJd (ORCPT + 71 others); Mon, 19 Dec 2022 14:09:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbiLSTJ3 (ORCPT ); Mon, 19 Dec 2022 14:09:29 -0500 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4083D7649 for ; Mon, 19 Dec 2022 11:09:27 -0800 (PST) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-43ea87d0797so112122017b3.5 for ; Mon, 19 Dec 2022 11:09:27 -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=F/CCMZCQj5dF++B+69iBkvBLnhcDqwiWIOUWa6+GvPo=; b=fPnsy+VG2rQkfW2tV40XYBIFVk636fd8vzN6bHaj9QYsmdNG71O8WJuAHbC/g9wgxu Q5NKMzQu9kOIB1g/XDA6Ho/FfSDTyzRBtIRfjWPjvkmqjx9al5mWf5TAuyaFdEbrmV4H YnWSsrbo9sQKWDD/Kp42iP164mM4dQj6t7liOgH/VyBAdW7wWgfXCGiM5uQAailkmGAT 17qFRfAFqiFGZEUYgvqgRUvzlZzfSEPJ0FpDsBUHufvC/xgdzDGmNyGn6HU+tufo+mPQ lIRwGGvBMcBuJ6sBn+hIYHmC0+GuIzDvNy9akoRC7KrJav9KWNrIBPIIYafd2LvADxm7 9IHQ== 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=F/CCMZCQj5dF++B+69iBkvBLnhcDqwiWIOUWa6+GvPo=; b=6Krd9W8UiX1aEtl1rHPuATo4qxm56muoDU+kAQD7MClk4vAmD25uh9VTyfpsHeW6+1 L38tB0ukSHIfhmHo8v54Bw45r87rilQkdHgZSuYCiDxQUEKimRrEfPrJ8VcT//bkka2l hLxZzs4nG6X9pIMl1zoCEgZ0QDIFn/JEzzxbf/xUJKuaYWzb1z6t3Nomr34w7Y0UsNXY r2DEvRKmi64kMmLOWEZqzuuiOR23JYq30i/RKimzCXj5oB95jxfBs1W4wnu9XL1znEmZ /SvSD+vbhS0A9kIcpQSnclk78xE6h7L4iK0qhzazgBplGQntu8NrS79gyo2h80eNmAVb yQGQ== X-Gm-Message-State: AFqh2kpW5W51l6pKsrqqEtvoa8HX6gmRVqX6dwJaFxhHVB+OSjYaffff T+7krDc74kzl3NfGGE9/EypzesHMN9pcT3jZBhc= X-Received: by 2002:a81:1205:0:b0:393:2287:bed9 with SMTP id 5-20020a811205000000b003932287bed9mr8103033yws.40.1671476966387; Mon, 19 Dec 2022 11:09:26 -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 i16-20020a05620a249000b006fa9d101775sm7503743qkn.33.2022.12.19.11.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 11:09:26 -0800 (PST) From: Dennis Lambe Jr To: Alessandro Zummo , Alexandre Belloni , Krzysztof Kozlowski , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Alexander Bigga , Dennis Lambe Jr Subject: [PATCH 1/3] rtc: m41t80: probe: use IS_ENABLED for CONFIG_OF Date: Mon, 19 Dec 2022 19:09:13 +0000 Message-Id: <20221219190915.3912384-2-dennis@sparkcharge.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221219190915.3912384-1-dennis@sparkcharge.io> References: <20221219190915.3912384-1-dennis@sparkcharge.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 undesireable if there's nothing inherently DT-specific about those functions. Signed-off-by: Dennis Lambe Jr --- 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, -- 2.25.1