Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3857645ima; Mon, 4 Feb 2019 06:24:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Hfl5BZ/DfIcMm1dJJvCxH7Sx6n8DBLUW/CJQGc4jVDff1RkOTKrZz/KPChT8+Arobmb2v X-Received: by 2002:a62:31c1:: with SMTP id x184mr52677384pfx.204.1549290247808; Mon, 04 Feb 2019 06:24:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549290247; cv=none; d=google.com; s=arc-20160816; b=zcDict0rnaL8T/I0JfpPVs1AWFHhlZHZPz4u2Cum+d8GyoEVLavol/em0TMdzea8xX WJrgg9qzeJCOsWvTfCAUbK4DUADuhIS7E53EVhabnSwXIdiUpwBwwWQYmk6LeQaH4zjD z82J8aPsDFX6El8go1CiHQEHerA+kZ76JiTCy8j5PZmcyeyiQ6VCRi0FVacCaV7S5o60 xkp87bz3eXbBg8Y6XLB7PLtDAqIXAzBhHqCGzqc4P9jyDN4aQu4PiYXFHVI5Ywu1KH8C vU8JcswPU8hbJIwwM8T/4qd/KIH7Z3jEezahgyLIOguP0RUzlgErTrsp/UD5PxQQJBNa m6Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ESopPEv/8vslS0BJSYdv66QBL1idUE45V1McnV2zN9E=; b=L9Bu7gVQxu4ZsLFlj5YzDt+5Ya6xf4TnCEaZTH6B7GrzFSJNiwqm57+hYLXGmrq3Nf Nn/9y2xkTcf6/ynUJm4eC5+IukGPmVgR2QkXpWCeAHLu/Rgiy069+vsyeDyUsVcJcMOz Euwi1B0SgkDCjUVsIy26c6TdlwpL9pQ5RmYue4t8f0M/7tz8jL69q98mmRITTNxVDQYG S6St97boI/HwbIl4beHkeKJbM7vVv3gCMnrWYzhwkrZMngZTCBbSYzlyPlhWR7afzLFp QD0Lki5pD0YqPyTuO/hxDy8/UldpoLhB4USGFeawtR01bGR/0vPswW5aD3liHoU/ArFg UmWQ== 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 s5si143205pgl.481.2019.02.04.06.23.51; Mon, 04 Feb 2019 06:24:07 -0800 (PST) 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 S1730415AbfBDMZS (ORCPT + 99 others); Mon, 4 Feb 2019 07:25:18 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:44433 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbfBDMZS (ORCPT ); Mon, 4 Feb 2019 07:25:18 -0500 Received: by mail-lf1-f66.google.com with SMTP id z13so10155424lfe.11; Mon, 04 Feb 2019 04:25:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ESopPEv/8vslS0BJSYdv66QBL1idUE45V1McnV2zN9E=; b=IkU3Jr19ayqWgsjVEVB9fZo/liR9DVh9fyrqt6r1GOzlZ59z7ccwbZbBdvqCaFYLwQ HaiPYa8hQ8h35F5q1y+GDb5kHLOLTjV6aB4qaC3AKqayyU/ircYwQJPnf0ppifDMOQV3 EB1Xyf2YSAidTuLYLvh+Hv0QYpPuYBvlXlsyaCS5oDKJTmFnm0WZq88cVr8Y06GLuyYQ mQWtMmgtH93ncdPpTgmFkPteCORKosfAI2UHSv4EpLB/IQ5qhpu8B2SXv2MlmRzTsu3M kY202bgrHCkMLplkoA2AJIK4SSjoKZvKZL3nxQ0s2sTC6838u17yYoSCnyg2pLeGUNJV 3ZKA== X-Gm-Message-State: AJcUukfVDcXDkTLIuZ7WanQ3GAux3l1wRSEDMacZphDfr+r+2VLopO/R 027cdJWTiyLCU6W4M2Vs2iQ= X-Received: by 2002:a19:4dd0:: with SMTP id a199mr41334933lfb.42.1549283114982; Mon, 04 Feb 2019 04:25:14 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id t22sm3294025lfb.0.2019.02.04.04.25.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 04:25:14 -0800 (PST) Date: Mon, 4 Feb 2019 14:25:11 +0200 From: Matti Vaittinen To: Linus Walleij Cc: Matti Vaittinen , heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, Lee Jones , Rob Herring , Mark Rutland , Mark Brown , Greg KH , "Rafael J. Wysocki" , Michael Turquette , Stephen Boyd , Bartosz Golaszewski , Sebastian Reichel , Liam Girdwood , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , linux-clk , "open list:GPIO SUBSYSTEM" , Linux PM list , linux-rtc@vger.kernel.org, LINUXWATCHDOG Subject: Re: [RFC PATCH v4 07/10] gpio: Initial support for ROHM bd70528 GPIO block Message-ID: <20190204122511.GG23791@localhost.localdomain> References: <5f63684b62c7a320c514088bcf9091ed7efbd2cc.1548935790.git.matti.vaittinen@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 04, 2019 at 12:29:53PM +0100, Linus Walleij wrote: > On Thu, Jan 31, 2019 at 1:08 PM Matti Vaittinen > wrote: > > > ROHM BD70528 PMIC has 4 GPIO pins. Allow them to be > > controlled by GPIO framework. > > > > IRQs are handled by regmap-irq and GPIO driver is not > > aware of the irq usage. > > > > Signed-off-by: Matti Vaittinen > (...) > > I dropped the review-by from Linus Walleij because I would like to > > get a comment on if locking is required when we check the direction > > in order to detect the correct register for getting the pin state. > > I don't know that. You isn't regmap locking inherently? This direction fetching and then the value reading are two separate operations at regmap-level. I guess the regmap can't be holding any locks during two indpendent operations. > > > My initial feeling is that locking makes no sense. > > Mine too. Yep. I change the comment to explain why I think this race condition is Ok. We can fix it if it ever turns out to be an issue. > > > + bdgpio->gpio.get_direction = &bd70528_get_direction; > > + bdgpio->gpio.direction_input = &bd70528_direction_input; > > + bdgpio->gpio.direction_output = &bd70528_direction_output; > > + bdgpio->gpio.set_config = &bd70528_gpio_set_config; > > + bdgpio->gpio.can_sleep = true; > > + bdgpio->gpio.get = &bd70528_gpio_get; > > + bdgpio->gpio.set = &bd70528_gpio_set; > > Drop the &ersand in from of the functions. All functions > are pointers. Yes they are. This & in front of functions when initializing a pointer with their addresss is my old habit. I liked to consistently use & when taking address of any beast, whether it was a variable or function. Getting rid of old habits is not so easy :/ I'll clean thisi at v5 and put back your Reviewed-by =) Thanks > > With that: > Reviewed-by: Linus Walleij > > Yours, > Linus Walleij -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then, he vanished ~~~