Received: by 10.192.165.148 with SMTP id m20csp897514imm; Wed, 25 Apr 2018 09:17:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/oWsQtlbVWYQKfvUVqGWEeXA/H274wPTs2FX/wGdAxp19f3n5otcExwbejATmlVnuqPNk X-Received: by 10.99.97.133 with SMTP id v127mr24021721pgb.441.1524673043356; Wed, 25 Apr 2018 09:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524673043; cv=none; d=google.com; s=arc-20160816; b=d1Hzz7sVZARNODn1KX4ocqbo6Km/9T2ucd5iLpMwn01A6365sq0WVWeZTRmNPNIHq0 IOJpy3P5VbXuX0/EmyKncfb0GG2tZ2vyS2w7efi5RLBszp1i9WhWIyRFOzpta0fWLzZL Sr6HDFbjxIFYX25sFpsAPxzv8IwdQgaiKuvrEMmWRyzBlli4IqPimj0pFShP2NDAJgxn 6or4y4ZHuSjHy8RtY65/lFZI7he4CSguHfSYS1A8fX4GYghxjXY2oZtZFwlrhXLfMqjp YrSYA3EquHrvwqYrhPtPPwq7y8FqzjFL6fBjOTKy9dZpyepsampTx1QB3zZ89myLxwpZ NPhg== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=N34auMWhvof9jkcuYu9MDD4bC+dzwqpei/btY0Pee34=; b=vqxLweXbU68mhL2joqsZarRSZbcFBYgT6zxCIzr9uGlLRV0hTCsMAmx2a3Xfvwqs/5 ausYOxJsy1iEp7lgtr5xGxv1f/gv/ik/zw6rZWlsZuor+ERgc0ppUASZwf77+qhtdmPM 8VDtlnVwjVN6CT7AYpZkyCyCW1ppb85eXD/KrjRtUKz++4LLMs/0hq7v/481rBZhtzYc PE2eMjMUUXJfmtyJYmYl0A/Z/eEIYKNWccQ8GC33VC4SwoKEN4Ty6nzqLfkGEP8kj1Ms g9HK0fPjNyitf6YMdci12Wrl9TCRLzpOx09H3eWFCeOHot4IGB+3pWcHqLBVn0zgmuE4 aahQ== 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 h4-v6si15619201pls.502.2018.04.25.09.17.08; Wed, 25 Apr 2018 09:17:23 -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 S1755806AbeDYQPy (ORCPT + 99 others); Wed, 25 Apr 2018 12:15:54 -0400 Received: from mga05.intel.com ([192.55.52.43]:56944 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755684AbeDYQPu (ORCPT ); Wed, 25 Apr 2018 12:15:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 09:15:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,326,1520924400"; d="scan'208";a="36103378" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga007.jf.intel.com with ESMTP; 25 Apr 2018 09:15:46 -0700 Message-ID: <1524672945.21176.594.camel@linux.intel.com> Subject: Re: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support From: Andy Shevchenko To: Javier Arteaga , Jacek Anaszewski , Pavel Machek Cc: Dan O'Donovan , Mika Westerberg , Heikki Krogerus , Lee Jones , Linus Walleij , linux-gpio@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 25 Apr 2018 19:15:45 +0300 In-Reply-To: <20180421085009.28773-3-javier@emutex.com> References: <20180421085009.28773-1-javier@emutex.com> <20180421085009.28773-3-javier@emutex.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2018-04-21 at 09:50 +0100, Javier Arteaga wrote: > Allow userspace to use the on-board LEDs as "upboard::". > + struct upboard_led *led = container_of(cdev, struct > upboard_led, cdev); #define to_upboard_led(cdev) container_of(cdev, struct upboard_led, cdev) ... led = to_upboard_led(cdev); > + struct upboard_led *led = container_of(cdev, struct > upboard_led, cdev); Ditto. > +static int __init upboard_led_probe(struct platform_device *pdev) Are you sure about __init here? > + struct upboard_led_data * const pdata = pdev- > >dev.platform_data; Don't use direct dereference to platform_data. > + if (!pdev->dev.parent) > + return -EINVAL; > + > + upboard = dev_get_drvdata(pdev->dev.parent); > + if (!upboard || !pdata) > + return -EINVAL; Wouldn't be better to supply regmap as part of platform data? It will allow be flexible of parent device. > +MODULE_LICENSE("GPL"); License mismatch. -- Andy Shevchenko Intel Finland Oy