From patchwork Fri Oct 31 13:20:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 39886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 016B8202FE for ; Fri, 31 Oct 2014 13:20:37 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id l18sf604961wgh.4 for ; Fri, 31 Oct 2014 06:20:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=EXIwKeTl+IF2T4VT+s1HenUKTOR0IbupzRlUhN5u/Xk=; b=XYbGuBRr8RrtWx/PxMU6FpcdszgPXaBJKYqX4HhEiN6b/lXB5NZK2o2jrjhsOWKdED 8yMsgpOc04hf+jU8AZOc2tHiXtUIgDdc4pHBAGpBtibtj15/bZlwhhbURKKXLwf11Uq4 dzdULCeF+SLNaSjK8GDy0rlOHIuelQpar1qIm3yeo2MrSYxQd5HTUUeBwfoLPgc7FMCJ P/nlDxLObzfsJ6/y7otMmgqTgsxQApAxRUqfpzHRbBJTES3sBNzUR7+B3ChgfLS8lRbm bysyvRwSZwPO/l8/zZqk8ZIn4J+79yMdrJUgqsrNihC63uOzBCX3ODLcCAXkrt+089kP zk2Q== X-Gm-Message-State: ALoCoQlraw3RPHg9e/iGfoDeKcRZWlrH3FvBb46HeBo1oDrt/RWeVUGx4Dfxcuys+0k6GQCnLGSh X-Received: by 10.112.26.82 with SMTP id j18mr340344lbg.16.1414761637124; Fri, 31 Oct 2014 06:20:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.199.38 with SMTP id jh6ls468619lac.9.gmail; Fri, 31 Oct 2014 06:20:37 -0700 (PDT) X-Received: by 10.112.64.66 with SMTP id m2mr2403238lbs.53.1414761636937; Fri, 31 Oct 2014 06:20:36 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id at1si16619476lbc.102.2014.10.31.06.20.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 06:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id p9so408667lbv.4 for ; Fri, 31 Oct 2014 06:20:36 -0700 (PDT) X-Received: by 10.152.120.199 with SMTP id le7mr3731782lab.67.1414761636808; Fri, 31 Oct 2014 06:20:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp200682lbz; Fri, 31 Oct 2014 06:20:34 -0700 (PDT) X-Received: by 10.66.245.140 with SMTP id xo12mr22578499pac.54.1414761633988; Fri, 31 Oct 2014 06:20:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw5si9225569pbc.133.2014.10.31.06.20.33 for ; Fri, 31 Oct 2014 06:20:33 -0700 (PDT) Received-SPF: none (google.com: linux-gpio-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326AbaJaNUc (ORCPT ); Fri, 31 Oct 2014 09:20:32 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:43268 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbaJaNUc (ORCPT ); Fri, 31 Oct 2014 09:20:32 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9VDKUEs031088; Fri, 31 Oct 2014 08:20:30 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9VDKUvI003365; Fri, 31 Oct 2014 08:20:30 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 31 Oct 2014 08:20:30 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9VDKTaY026802; Fri, 31 Oct 2014 08:20:29 -0500 Date: Fri, 31 Oct 2014 08:20:05 -0500 From: Felipe Balbi To: Linus Walleij CC: Felipe Balbi , David Cohen , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , stable Subject: Re: [PATCH] pinctrl: baytrail: show output gpio state correctly on Intel Baytrail Message-ID: <20141031132005.GB1273@saruman> Reply-To: References: <1412355319-18946-1-git-send-email-david.a.cohen@linux.intel.com> <1413224639-21552-1-git-send-email-david.a.cohen@linux.intel.com> <20141013191405.GB29810@saruman> <20141013192404.GB4034@psi-dev26.jf.intel.com> <20141013192632.GC29810@saruman> <20141013193618.GD29810@saruman> <20141028144249.GD8123@saruman> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, On Fri, Oct 31, 2014 at 09:12:16AM +0100, Linus Walleij wrote: > On Tue, Oct 28, 2014 at 3:42 PM, Felipe Balbi wrote: > > On Tue, Oct 28, 2014 at 11:15:20AM +0100, Linus Walleij wrote: > >> On Mon, Oct 13, 2014 at 9:36 PM, Felipe Balbi wrote: > >> > On Mon, Oct 13, 2014 at 02:26:32PM -0500, Felipe Balbi wrote: > >> > >> > I also noticed that this is missing: > >> > > >> > diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c > >> > index e12e5b0..7db5ab9 100644 > >> > --- a/drivers/pinctrl/pinctrl-baytrail.c > >> > +++ b/drivers/pinctrl/pinctrl-baytrail.c > >> > @@ -614,3 +614,9 @@ static int __init byt_gpio_init(void) > >> > } > >> > > >> > subsys_initcall(byt_gpio_init); > >> > + > >> > +static void __exit byt_gpio_exit(void) > >> > +{ > >> > + platform_driver_unregister(&byt_gpio_driver); > >> > +} > >> > +module_exit(byt_gpio_exit); > >> > >> But the Baytrail driver is not a loadable module, it is bool: > >> > >> config PINCTRL_BAYTRAIL > >> bool "Intel Baytrail GPIO pin control" > >> depends on GPIOLIB && ACPI && X86 > >> > >> (...) > >> > >> So I guess it won't need handling for removal, as it can only > >> be compiled-in. > > > > you can still unbind it through sysfs, right ? The thing also already > > provides a ->remove() method anyway. > > Yes you're right of course... > > But another way to get rid of the dilemma is to set > .suppress_bind_attrs = true on the .driver field of the > device driver. The one can't unbind it through sysfs anymore. > > .driver = { > .name = "foo", > .suppress_bind_attrs = true, > }, > > So one of them need to be done. > > I suspect this is a kind of common problem... so instead of taking of taking a three-liner which just makes sure this can be used as "intended" you prefer to: I don't quite care since this is not an architecture I work for, but I prefer drivers which can be unbound one way or another. Not to mention that there's already a ->remove callback on the platform_driver anyway. diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c index e12e5b0..254ba81 100644 --- a/drivers/pinctrl/pinctrl-baytrail.c +++ b/drivers/pinctrl/pinctrl-baytrail.c @@ -587,16 +587,6 @@ static const struct acpi_device_id byt_gpio_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, byt_gpio_acpi_match); -static int byt_gpio_remove(struct platform_device *pdev) -{ - struct byt_gpio *vg = platform_get_drvdata(pdev); - - pm_runtime_disable(&pdev->dev); - gpiochip_remove(&vg->chip); - - return 0; -} - static struct platform_driver byt_gpio_driver = { .probe = byt_gpio_probe, .remove = byt_gpio_remove, @@ -605,6 +595,7 @@ static struct platform_driver byt_gpio_driver = { .owner = THIS_MODULE, .pm = &byt_gpio_pm_ops, .acpi_match_table = ACPI_PTR(byt_gpio_acpi_match), + .suppress_bind_attrs = true, }, };