From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FD8344685B for ; Mon, 20 Jul 2026 19:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784576368; cv=none; b=WBLLO3Nb0YAAyeqn9G+XlQa6hBQ4Ari7z427ZlgU5tXIxBeKaO2F+xEKpMBgICJPu/9iS4o4A+9oczIjDpfmKZ3sspMbQnkRwJe0y0pHbKm5R8GdOjOnnkHXn0sokGMN1d1Pvt7Pt841SCNx29OmAOaZrd0YbYq7rGAyax9BYl8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784576368; c=relaxed/simple; bh=BIgF/MBWBkH+YrQaMxoT9KyYaoF+iLuNvKx4PL9FFaQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f6albZM7LA3eH7ehDH5ozokMgo4jwSq61QwBYBqG80667KmEtEo23voRkJhh30CX90bdJWta3AjPv5lrdQW9cAZhy24ZUndSwJ1nEINZbTfBB4nVBxmAEn1lhZITyXKKq0HW7LldcYyduyETv37D9xuBvo7xsmOrUdRwOy/ABCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jhgh+rt3; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jhgh+rt3" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-38de840f2f0so6631814a91.0 for ; Mon, 20 Jul 2026 12:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784576367; x=1785181167; 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:content-type; bh=G26pkiVGOQfvjhUhovAmEpMH2UgTqMGfpTU7jPDu8MQ=; b=Jhgh+rt3fxUkm4lKjwsoGfrDI/6qQ/27QJgL7mU6LLOFoiwOWzx4YQviwwlmV9hCQz m787Eg9X7GgCi6DlPYNNicHaBZnp3aXuqXguURISm8t2xnqSuyCIVOCmUDiHqsW2W02r bIi2ac93bj4l6xEAmcoZyZi5Z2ugZ7W/V7+UjyaST8Qqyc09cQXnDCeCFf+Nb9nHGwJ8 F3HFM3jwd5wtdA1GDmr1oqF59C4tsUN2iuBuU59A0D/ASjuBecTZM+2bx14g+h+PC3Vu 5SqUcaAkEJTxTYBlpQlWBFkTQ32N1JBaVJppht6aC6tpNa2C8qyYUuc4U8nAfFEod0Co 4Sfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784576367; x=1785181167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=G26pkiVGOQfvjhUhovAmEpMH2UgTqMGfpTU7jPDu8MQ=; b=bDhIhahLiH1PnomO0uSmtAKkHRFIaPoZ+Yf4G6qnbo95LSODZ8pITrk0fW8xJ6TFPF P0daIr1UsxMr565CbKq9+nVrRwSI1potxqWiVYBmx289v8t68iA0q5bQGG6rPmrHgFQv /fKmbW5GEqnOcdteX14t4Z/RhA2ysH2HX939xf8VbGSlSZZVxYiS1nIWjWDxos0zZovU cXdByMlvttdh4AUhzKvh/lUNxZPd+sKgnyzXl/Bp/9XSGQRuvhTp7wpjW405RBa6B2La pflu9N1DOEK2A5grvH3ZegcqcHquGQzGJp7n8jWx5uOXTtaB4s8ZAKrKlAv3Un9wZLFi lCZQ== X-Forwarded-Encrypted: i=1; AHgh+RoVmy5xpUZj2HNWbJy6IPcB7/Yb24h2ZhUnKslq5wBMW5WNPXAEdubp5YxL82p9q2iIuF19x9F2PN3b/EM=@vger.kernel.org X-Gm-Message-State: AOJu0YxSDe8rUvJh51dFNX/piCu6nX8PmVSfLH8d6nxfGcSz7AU6HRkY Kz/09TkrKeDhsjRabkIF5HFP7MR7JBj14Sh0tAOTFmYDM3ai3Ahzjp0= X-Gm-Gg: AfdE7cmPxqz9ilgVCIhhmn/BKXWfnBs6IIWW/6vcryQ/NDL37Alz14atWCNonm55WRe GBgk4vBr1n0iJIsarII9msloVbFNIW80NXdEdN6iRxdUdV8GyYc6Bx/pn6JANxTYn7APhc7BY9O J2mvJNyqNYbh+JoaUnSQiJCI4qewcDRwRp0jpp1eWNAct4OJ9gQjlIRWJGSoRIeciJ9VCX8AlVp 9QKZbB9WTozM181XWF4YgJoWwytI2JwfbqnrgZApTFyxHVOHs+GgFsQNa31SbQ/Oyl8aYvpuSB3 MS+7x65HMQIBh87PmU9P8VtBpIyJPMe88/mSi4zqaAm3zWiK0YrcBXKm21tV/IZl4UA5I1ONw5z ePYK7h/EdUuBu4mm/7Z2Aqi9i6I1hIKS6Q/WFaZdoCwKR5HjptEXQzx/BvE3Eg4ITDXfofWGvfA zUNaVzxeXFB5DAbEbqyITwpIHv+MOIjjiXTi1g+cB9 X-Received: by 2002:a05:6300:95:b0:3bf:e2f1:1b08 with SMTP id adf61e73a8af0-3c3ad9717d4mr16450850637.40.1784576366686; Mon, 20 Jul 2026 12:39:26 -0700 (PDT) Received: from localhost.localdomain ([101.0.63.64]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce29ffb13sm33935340c88.6.2026.07.20.12.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 12:39:26 -0700 (PDT) From: Nikhil Gautam To: Jonathan Cameron Cc: Linus Walleij , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nikhil Gautam Subject: [PATCH v1 2/3] iio: light: gp2ap002: re-enable irq if runtime suspend fails Date: Tue, 21 Jul 2026 01:09:10 +0530 Message-Id: <20260720193911.74919-3-nikhilgtr@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260720193911.74919-1-nikhilgtr@gmail.com> References: <20260720193911.74919-1-nikhilgtr@gmail.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 gp2ap002_runtime_suspend() disables the irq before writing OPMOD. If the write fails, the callback returns an error with the irq still disabled while the PM core marks the device active again. re-enable the irq before returning the error so the irq state matches the active state the PM core restores. Fixes: 97d642e23037c ("iio: light: Add a driver for Sharp GP2AP002x00F") Signed-off-by: Nikhil Gautam --- drivers/iio/light/gp2ap002.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c index ea971fec0b56..96dab4d1d8ac 100644 --- a/drivers/iio/light/gp2ap002.c +++ b/drivers/iio/light/gp2ap002.c @@ -650,6 +650,7 @@ static int gp2ap002_runtime_suspend(struct device *dev) /* Disable chip and IRQ, everything off */ ret = regmap_write(gp2ap002->map, GP2AP002_OPMOD, 0x00); if (ret) { + enable_irq(gp2ap002->irq); dev_err(gp2ap002->dev, "error setting up operation mode\n"); return ret; } -- 2.39.5