From patchwork Tue Sep 5 18:53:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13374971 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 43C01C83F3E for ; Tue, 5 Sep 2023 19:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbjIETIz (ORCPT ); Tue, 5 Sep 2023 15:08:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236626AbjIETIw (ORCPT ); Tue, 5 Sep 2023 15:08:52 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823CAE4E for ; Tue, 5 Sep 2023 12:08:23 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b9338e4695so44305761fa.2 for ; Tue, 05 Sep 2023 12:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1693940839; x=1694545639; 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=ENyvcqOYq6piL9aYNsmVNToV9MKgtDTkh/A8a81eQKQ=; b=mBpV1DokPPsJqmr9D3jGBFlS7LNMxQzB7+7Z1Zs6tuXYu1w5vJlYxVPkSscPN7F+q1 v/NRd/DXWAmwXhXaWDdpSfMuAwtencZQ0yF4nrxrAGwzt+KVX8N9Smg9Tw4OKJkjxvBZ GgJbJK6Q99nLY7WM1tyURlZJGfXMosc3cOWZktwV2U2SVWggqMZs3JPosqk/VEFd/PMF 7vN/belEpRQtv3fnB/oQukQYpfLC6cbzrm7fWb+q0A8K0yEDZRgnaiFATauKLaow0699 MG4Q7dxDKWhoLUBI8BSSOpIfoNI8szjV1OUBh/7q/gyT8bjalSXr3k+91DUzBE/4HKkO RgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693940839; x=1694545639; 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=ENyvcqOYq6piL9aYNsmVNToV9MKgtDTkh/A8a81eQKQ=; b=VfITcMeoaar9BpvILXHQTA4iSzRHAQMv/nfVN4NYeiyZs7AiqKQIEZVztXFQ2wwWje pVRrpVsi5PnSCvyrDK2RNbUAWRDtNkPX+PQFKY6eIs946P/jdQkuqGc6B75TBImVhUSk lfFawWKQ+DFTGCnRIw6Z2WgN+xL9RS6QSDqO5nvuEMyTrEVi0jyW5NqltaZhJswHD3Tj pmrrx9o5iALWFKQS6pjLZLjTqD12+qEe19MEpmqDB2QKHmTCCojEgwKK8WDOFzLr17YC yVyHSPoEg4ZFRBBWrAwY3dBBPkIL2SRBOLJ7OPedOLssFfTVrvxNFLnNxQ09A5dbjKHo QdYA== X-Gm-Message-State: AOJu0YyuF0ObMCGMJEavZvVLj14r8ccp9oW2yfhbgbl973QQrDi0NBSn yCLy0ZJFT/5/67RHpbiQ7ukczolqHuvyXUnjkA4= X-Google-Smtp-Source: AGHT+IETzIspKoYp23peY3Mtm+8LIAaFcti4lea83HydZgiIlGoA8ysWTU5DS/F06PC8tJEHYtDSiA== X-Received: by 2002:a1c:7410:0:b0:401:d1a3:d7f7 with SMTP id p16-20020a1c7410000000b00401d1a3d7f7mr407237wmc.30.1693940025441; Tue, 05 Sep 2023 11:53:45 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:7a54:5dbc:6d09:48b7]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c249100b003fbc30825fbsm17550010wms.39.2023.09.05.11.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 11:53:45 -0700 (PDT) From: Bartosz Golaszewski To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Mika Westerberg , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Dipen Patel , Thierry Reding , Jonathan Hunter , Hans de Goede , Mark Gross Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 16/21] gpio: of: correct notifier return codes Date: Tue, 5 Sep 2023 20:53:04 +0200 Message-Id: <20230905185309.131295-17-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230905185309.131295-1-brgl@bgdev.pl> References: <20230905185309.131295-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bartosz Golaszewski According to the comments in linux/notifier.h, the code to return when a notifications is "not for us" is NOTIFY_DONE, not NOTIFY_OK. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij --- drivers/gpio/gpiolib-of.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 531faabead0f..5515f32cf19b 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -834,14 +834,14 @@ static int of_gpio_notify(struct notifier_block *nb, unsigned long action, switch (of_reconfig_get_state_change(action, arg)) { case OF_RECONFIG_CHANGE_ADD: if (!of_property_read_bool(rd->dn, "gpio-hog")) - return NOTIFY_OK; /* not for us */ + return NOTIFY_DONE; /* not for us */ if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) - return NOTIFY_OK; + return NOTIFY_DONE; chip = of_find_gpiochip_by_node(rd->dn->parent); if (chip == NULL) - return NOTIFY_OK; /* not for us */ + return NOTIFY_DONE; /* not for us */ ret = of_gpiochip_add_hog(chip, rd->dn); if (ret < 0) { @@ -850,22 +850,22 @@ static int of_gpio_notify(struct notifier_block *nb, unsigned long action, of_node_clear_flag(rd->dn, OF_POPULATED); return notifier_from_errno(ret); } - break; + return NOTIFY_OK; case OF_RECONFIG_CHANGE_REMOVE: if (!of_node_check_flag(rd->dn, OF_POPULATED)) - return NOTIFY_OK; /* already depopulated */ + return NOTIFY_DONE; /* already depopulated */ chip = of_find_gpiochip_by_node(rd->dn->parent); if (chip == NULL) - return NOTIFY_OK; /* not for us */ + return NOTIFY_DONE; /* not for us */ of_gpiochip_remove_hog(chip, rd->dn); of_node_clear_flag(rd->dn, OF_POPULATED); - break; + return NOTIFY_OK; } - return NOTIFY_OK; + return NOTIFY_DONE; } struct notifier_block gpio_of_notifier = {