From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [PATCH 2/2] gpiolib: assign chip owner to dev->driver->owner if not set Date: Thu, 16 Jul 2015 14:53:17 +0300 Message-ID: <55A79B2D.2080900@ti.com> References: <1435253451-19817-1-git-send-email-grygorii.strashko@ti.com> <1435253451-19817-2-git-send-email-grygorii.strashko@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from devils.ext.ti.com ([198.47.26.153]:47090 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbbGPLxX (ORCPT ); Thu, 16 Jul 2015 07:53:23 -0400 In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Linus Walleij Cc: Alexandre Courbot , Sekhar Nori , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Johan Hovold On 07/16/2015 02:25 PM, Linus Walleij wrote: > On Thu, Jul 16, 2015 at 1:22 PM, Linus Walleij wrote: >> On Thu, Jun 25, 2015 at 7:30 PM, Grygorii Strashko >> wrote: >> >>> Assign GPIO chip owner field to chip->dev->driver->owner if it was not >>> configured by GPIO driver. >>> >>> Cc: Johan Hovold >>> Signed-off-by: Grygorii Strashko >> >> Patch applied with Alex' review tag. >> >>> There is also one positive additional side effect: >>> lines like below can be removed from a lot of GPIO >>> drivers >>> rdc321x_gpio_dev->chip.owner = THIS_MODULE; >> >> Yes let's do this :) > > Or actually, I have had some second thought to why gpio_chip > is duplicating struct members from struct device at all. > > Why should it even have "owner" and "of_node"? > > Should we not just rewrite this code to follow the struct device *dev > pointer in gpio_chip and use "owner" and "of_node" from there? > Seems not all drivers implemented using Dev/Driver approach, so they don't have dev at all ;) gpio-samsung.c for example (non-DT driver). -- regards, -grygorii