Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp26430lqt; Sun, 17 Mar 2024 23:07:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW14jKhA7c9IY9i42QNeTBRH3D7o5cFpjaZ2cX7oCr71T0PqcmXLx/Kc1jHFoZp19iShSGmC1aRJ/rsSEiKTWdzxJvusXF3miLJ+9aPBw== X-Google-Smtp-Source: AGHT+IG4UCGWLzLDYF4JAO80HUBO31Ra5QvHwtthZ1Hc5KHFDdiszekrbXUEL9WdAZN3U6Y+V7AW X-Received: by 2002:a17:906:459:b0:a46:8a6b:dfca with SMTP id e25-20020a170906045900b00a468a6bdfcamr5617620eja.6.1710742065101; Sun, 17 Mar 2024 23:07:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710742065; cv=pass; d=google.com; s=arc-20160816; b=PXExyElVsh+9mascRndRlXofQ3EhKzwPIb5dDRJSFQAKL9Ir51kP3hQnrG/Q7pJE6r i8Cuq1MVcb5u0XB7MF+DYKhm84/sMkGssCf7gxWFvEd2bEFqsTM2aDWQGTWiyvNo1eg9 vJ6JMgmee9LnMwdxTlUuWCicq3G98kx4OXdChlLJ/SsagKXmIeoYd3QdAjKQatJLdNve J6xTE/yhgkqIwL6n5g7YqX91yJn6dNpMVp5zlaLjv60FD7ME05TjFXDV5j2GpsO2vxwA iFaToUzkP30ns1dTiDI7E77rZK010239lkgqLqt7kHCxkoMckbyUmc6otGrlzm6hkbhn oYPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IIMeYQhVJsMjHJOrO1EdAXLf7xCV4g1QUz3hfpcGY/A=; fh=CN1lw5Tpnz/2ukaLG3t0Y+t771kwhtVB6zI6Fpz3ohA=; b=FsVhW7A1s1YCCJ1gbTwQsv2iRwYrfGuofHigVy/Td8qxGvbcLZxdcNdA5yRL9llsT2 s9oz3n+cpcw4irtQFlWolL7Ji9oz4FBno4YRzhD349A87+BpeVs7Czsm4Eq3Ew+zzras 95yt9VhpPpGZod8eJYQzEHwBSWkC8fFHoEUhtUpXY+vuSJaTPWmjHw8019WIUQD/2XmI ddGWVmqIIrUs85NLBWofcMG+FPyy2FPzO1KD2fLyympNkL8Vr1m84qwEEbdnnYfzlp7Y ac7yuGoWVSiL4AuKXF/DC65O6RBxzNj2CinpC3qnR323as+YO92+fvOJGYHCjHtQjeqZ Bsuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=W35K4ywy; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-105732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l16-20020a170906a41000b00a46a6459bd3si1967276ejz.803.2024.03.17.23.07.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 23:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=W35K4ywy; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-105732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D315D1F2120F for ; Mon, 18 Mar 2024 06:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72B4B24A08; Mon, 18 Mar 2024 06:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="W35K4ywy" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1148922EE0; Mon, 18 Mar 2024 06:06:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710742014; cv=none; b=diEss45mhLaf+upXgrMSDiosLHZMJtEm/zfqwC1bqlUmD5GjA1bZnVNRQxQsOtptMcRvEHFmUJ2nUSySOUKIJU2+P/vQ0KGugN/G89Bh8UPRJGGijbeVYXu2pMXV/TGjjYTJVOcX9zfuZaG/ysG4EP56wcO4mlF4tzDzsToVKQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710742014; c=relaxed/simple; bh=jaZkv8i6NdJT+wHMF9ub75fSWECjyHOvXBytAWOA6+I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S+DaVBAABvcQYH7NZnf7yQcTJ4VZKHXmn+ARvgtM7NggLcsRTA+3JLEIcc4ti3LHQ8cej34RaRE+S9dmGSec4w8xQjTE1A7vbryo2qdP5JgXkiIAZWP8dEzIHS0Iy4VRlE1BXVZ1X/WxXzRSCMpW1d+4tJs57Uw1KnVM5Pi2Ge0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=W35K4ywy; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42I5tVCW053441; Mon, 18 Mar 2024 00:55:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1710741331; bh=IIMeYQhVJsMjHJOrO1EdAXLf7xCV4g1QUz3hfpcGY/A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=W35K4ywypteT3P3yrYzqpECRvbU8xZwd+e/ZAmGW/bc8CCfEK8vtTd48hP1gNPyfq oR4OTqJ4ZuVw7Fgmk3TxxMfDNiA+LYmNl/TH1EXrgSd5fMqK7VuTI606pbbwof4fPm c9U7T7JAQR1zGA5C6aE6f4S4ZAzUmh3swquGUlYs= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42I5tVNx016614 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 18 Mar 2024 00:55:31 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 18 Mar 2024 00:55:30 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 18 Mar 2024 00:55:30 -0500 Received: from dhruva.dhcp.ti.com (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42I5tKiF082113; Mon, 18 Mar 2024 00:55:27 -0500 From: Dhruva Gole To: Ulf Hansson , "Rafael J. Wysocki" , Adrian Hunter CC: Tony Lindgren , Len Brown , Pavel Machek , Greg Kroah-Hartman , Viresh Kumar , , Dhruva Gole , , , Subject: [PATCH 1/3] PM: wakeup: make device_wakeup_disable return void Date: Mon, 18 Mar 2024 11:20:52 +0530 Message-ID: <20240318055054.1564696-2-d-gole@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318055054.1564696-1-d-gole@ti.com> References: <20240318055054.1564696-1-d-gole@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 The device_wakeup_disable call only returns an error if no dev exists however there's not much a user can do at that point. Rather make this function return void. Signed-off-by: Dhruva Gole --- drivers/base/power/wakeup.c | 11 +++++++---- include/linux/pm_wakeup.h | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index a917219feea6..752b417e8129 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -451,16 +451,15 @@ static struct wakeup_source *device_wakeup_detach(struct device *dev) * Detach the @dev's wakeup source object from it, unregister this wakeup source * object and destroy it. */ -int device_wakeup_disable(struct device *dev) +void device_wakeup_disable(struct device *dev) { struct wakeup_source *ws; if (!dev || !dev->power.can_wakeup) - return -EINVAL; + return; ws = device_wakeup_detach(dev); wakeup_source_unregister(ws); - return 0; } EXPORT_SYMBOL_GPL(device_wakeup_disable); @@ -502,7 +501,11 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable); */ int device_set_wakeup_enable(struct device *dev, bool enable) { - return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev); + if (enable) + return device_wakeup_enable(dev); + + device_wakeup_disable(dev); + return 0; } EXPORT_SYMBOL_GPL(device_set_wakeup_enable); diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 6eb9adaef52b..428803eed798 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h @@ -107,7 +107,7 @@ extern void wakeup_sources_read_unlock(int idx); extern struct wakeup_source *wakeup_sources_walk_start(void); extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws); extern int device_wakeup_enable(struct device *dev); -extern int device_wakeup_disable(struct device *dev); +extern void device_wakeup_disable(struct device *dev); extern void device_set_wakeup_capable(struct device *dev, bool capable); extern int device_set_wakeup_enable(struct device *dev, bool enable); extern void __pm_stay_awake(struct wakeup_source *ws); @@ -154,10 +154,9 @@ static inline int device_wakeup_enable(struct device *dev) return 0; } -static inline int device_wakeup_disable(struct device *dev) +static inline void device_wakeup_disable(struct device *dev) { dev->power.should_wakeup = false; - return 0; } static inline int device_set_wakeup_enable(struct device *dev, bool enable) -- 2.34.1