Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1286790imm; Wed, 17 Oct 2018 17:15:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV62N7wYMgF335e9CKoGIcJhfHInsJt5n+gP54xJFDpKTF9naiQHUWriXZq1XzzcaM0ZNC/6N X-Received: by 2002:a62:fc13:: with SMTP id e19-v6mr28714712pfh.101.1539821743144; Wed, 17 Oct 2018 17:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539821743; cv=none; d=google.com; s=arc-20160816; b=iCYH6F9+i6915pLQzSKxHh3jSuz1GcMdX82lxtKL1cyaJR0tdBL7pKwQqoHCAkK9Zq ZkJhGeGL+p9qRomRYee+UxXfl3PvoBIHCeSU+7hNtT6x6nkP3hIAp/rrow/SLiI2Aac7 D7ahncMtsVRY24h44S4ar7vRyzygD6JglyE4gUMRMdveldM4+wk2cwpqX5J3ap9MHYDd R+ZLfpmc/IqSGhfE8Mg8p9vXq/Gs3yXxTK7qd2wKsmXdoH+q6MbzpNC3sM5fH6HPoNQ0 aZnrNM+FCn32wI3hm+bA6J54ehhTEi5IJicPkW/uj+capOf5JyZTKfONf247olzuhDgy Bj5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ALtPqKAg4qZtB6GqcZILH5yUKXsho6y/lZ2wk2LsTdc=; b=oSdthgNI69Fjp7ZriuroD6r5zNk39K3YKt3SyyOA1uwdHYgTecTKAApEB8xl1S1Dqc EpHNqX9jJNDWs22/AAlMjQuMN8ZRzFmWXM7FhsX+Y4Q8kj/bL0HsA13m+HmNRyt7mDj1 UpQMmpjkPTNTp36I3Y/lPz49j8NPJzqB5KpvJJp1S2l0/vsPy15MIsZMvPMFHddacsCr tpGbvjoquzZEF1x7X9y78EL/DyrKxd00/gZ1e4pdqpOADfa7LygOUNn/8ACRy1aQDqTp nZsEHP+NyTaJ1Ryn5/vObAaMpNEhQsxJYMZkEgNvBAUaWoGkU17zI8CHpC/RvGw7BlF3 bOKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127-v6si19198473pgc.234.2018.10.17.17.15.10; Wed, 17 Oct 2018 17:15:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbeJRIMw (ORCPT + 99 others); Thu, 18 Oct 2018 04:12:52 -0400 Received: from dliviu.plus.com ([80.229.23.120]:40424 "EHLO smtp.dudau.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727260AbeJRIMw (ORCPT ); Thu, 18 Oct 2018 04:12:52 -0400 Received: from mail.dudau.co.uk (bart.dudau.co.uk [192.168.14.2]) by smtp.dudau.co.uk (Postfix) with SMTP id 1993651E5478; Thu, 18 Oct 2018 01:14:37 +0100 (BST) Received: by mail.dudau.co.uk (sSMTP sendmail emulation); Thu, 18 Oct 2018 01:14:37 +0100 From: Liviu Dudau To: Jacek Anaszewski Cc: Linus Walleij , Pavel Machek , linux-leds@vger.kernel.org, LKML , Liviu Dudau Subject: [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds Date: Thu, 18 Oct 2018 01:14:32 +0100 Message-Id: <20181018001432.710-1-liviu@dudau.co.uk> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device") removed the common code path that set the led_dat->gpiod pointer in create_gpio_led(), but only added it back for the devices that have a valid gpio_led_platform_data structure. Calling gpio_leds_create() in gpio_led_probe() is not enough to get a valid gpiod pointer. Fortunately enough, gpio_leds_create() already gets the needed pointer, we just need to assign it to the relevant gpio_led_data structure. Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device") Cc: Linus Walleij Cc: Jacek Anaszewski Signed-off-by: Liviu Dudau --- Hi, I found this issue while testing linux-next-20181017, I don't know how stable the leds for-next tree is in terms of commit IDs, if that gets rebased then the Fixes commit ID needs updating. Best regards, Liviu drivers/leds/leds-gpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 32fa752565bc..45e012093865 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -163,6 +163,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) return ERR_CAST(led.gpiod); } + led_dat->gpiod = led.gpiod; + fwnode_property_read_string(child, "linux,default-trigger", &led.default_trigger); -- 2.19.0