From patchwork Mon Jul 12 06:10:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 473867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEEC5C11F69 for ; Mon, 12 Jul 2021 07:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8A5F610D0 for ; Mon, 12 Jul 2021 07:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242880AbhGLHZ5 (ORCPT ); Mon, 12 Jul 2021 03:25:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:34084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239371AbhGLHWx (ORCPT ); Mon, 12 Jul 2021 03:22:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEF0B61221; Mon, 12 Jul 2021 07:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074405; bh=zzTE9mOH1poUGryq9U6dVffdBcfSimbZPtQfVJj3PdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LA9LWwahY3FiUdGn0PGelN9JjezA52WcZl7xKUaA0fCtivNpZJj7IX1EN/vm6rNd0 g5+sKPQ4exbqZerYmlKJwpm0/4o8FlqDzmbvNtYJ5m9CyRK6HDmx8IQVfveoWWliTw Z0AEglotTMHI5fu8DxIXlxCj2AcLRsBqQn/QMQUc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean-Jacques Hiblot , Andy Shevchenko , Pavel Machek , Sasha Levin Subject: [PATCH 5.12 568/700] leds: class: The -ENOTSUPP should never be seen by user space Date: Mon, 12 Jul 2021 08:10:51 +0200 Message-Id: <20210712061036.550635243@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Andy Shevchenko [ Upstream commit 0ac40af86077982a5346dbc9655172d2775d6b08 ] Drop the bogus error code and let of_led_get() to take care about absent of_node. Fixes: e389240ad992 ("leds: Add managed API to get a LED from a device driver") Cc: Jean-Jacques Hiblot Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek Signed-off-by: Sasha Levin --- drivers/leds/led-class.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 2e495ff67856..fa3f5f504ff7 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -285,10 +285,6 @@ struct led_classdev *__must_check devm_of_led_get(struct device *dev, if (!dev) return ERR_PTR(-EINVAL); - /* Not using device tree? */ - if (!IS_ENABLED(CONFIG_OF) || !dev->of_node) - return ERR_PTR(-ENOTSUPP); - led = of_led_get(dev->of_node, index); if (IS_ERR(led)) return led;