Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755125AbcDGFdo (ORCPT ); Thu, 7 Apr 2016 01:33:44 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:54207 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809AbcDGFdm (ORCPT ); Thu, 7 Apr 2016 01:33:42 -0400 X-AuditID: cbfec7f4-f796c6d000001486-5f-5705f132e732 Subject: Re: [PATCH 1/9] iio: adc: exynos_adc: use regmap to retrieve struct device To: Alison Schofield References: <2329d20396db00b60f4e7d2e783ea46b48eea9c1.1459918214.git.amsfield22@gmail.com> <5704B4A4.1070704@samsung.com> <20160406203308.GA3462@d830.WORKGROUP> Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, kgene@kernel.org, k.kozlowski@samsung.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org From: Marek Szyprowski Message-id: <5705F131.4090201@samsung.com> Date: Thu, 07 Apr 2016 07:33:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-version: 1.0 In-reply-to: <20160406203308.GA3462@d830.WORKGROUP> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRmVeSWpSXmKPExsVy+t/xK7pGH1nDDVbN4rd4+raR0eJB0yom i9cvDC36H79mttj1/w2zxZLJ81ktNj2+xmox78g7FovLu+awWcw4v4/J4veuY+wO3B47Z91l 9/jwMc5j06pONo/NS+o9lrw5xOpxvvkIo0ffllWMHp83yQVwRHHZpKTmZJalFunbJXBlrD3m VNDOX3F7wzrWBsZ/3F2MnBwSAiYSHUums0LYYhIX7q1n62Lk4hASWMoocXfNEyYI5zmjxI4F H4EyHBzCAqES935EgjSICGhLtG5fBVVzgVHiycYWRhCHWeAPo8SavhlsIFVsAoYSXW+7wJp5 BbQk9j9OAAmzCKhKnNy3CKxEVCBGom3LIiYQm1dAUOLH5HssIDangLHEp113mUFsZgEziS8v D7NC2PISm9e8ZZ7AKDALScssJGWzkJQtYGRexSiaWppcUJyUnmuoV5yYW1yal66XnJ+7iRES JV92MC4+ZnWIUYCDUYmH16KTNVyINbGsuDL3EKMEB7OSCG/VK6AQb0piZVVqUX58UWlOavEh RmkOFiVx3rm73ocICaQnlqRmp6YWpBbBZJk4OKUaGBUWLZrVxWKn6e362baGpdXDIb6KP+VM 4YLeW22eVzZavrvq1Wr+OMhh6bsOhijJY0HcjyXMuKxSHxTP6dn5xfJiwMcTfbe+9xRdF7/0 sOYpY3PL3E13On9bB7I//JopL2Oi1n4rcL+H/ZVu9avuLrfEMlfvuCG1I4vzVvmLOzu+Sx24 zbNTU4mlOCPRUIu5qDgRAHmC5b+OAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1876 Lines: 49 Hello, On 2016-04-06 22:33, Alison Schofield wrote: > On Wed, Apr 06, 2016 at 09:03:00AM +0200, Marek Szyprowski wrote: >> Hello, >> >> On 2016-04-06 07:15, Alison Schofield wrote: >>> Driver includes struct regmap and struct device in its global data. >>> Remove the struct device and use regmap API to retrieve device info. >>> >>> Patch created using Coccinelle plus manual edits. >>> >>> Signed-off-by: Alison Schofield >> This patch changes the struct device which is used by the driver to report >> errors. The driver used correctly the struct device associated with its >> device tree node, while after the patch it will use device which is >> associated with PMU regmap, which is a different device. PMU regmap is there >> only to enable/disable the ADC block and it is not the regmap used to access >> registers of the ADC device. >> >> I would prefer to drop this patch. > Thanks Marek! Please check my understanding. Driver is not carrying > a duplicate struct device. The regmap in exynos_adc is *not* this > devices regmap. It belongs to the PMU, (power mgmt unit?) Exactly. > It seemed excessive to carry around a struct device just for the > dev_err messages, but, we need that struct to extract the correct > iio_dev struct. Without a regmap belonging to this actual device, > no efficiencies can be gained in exynos, and the patch will be > dropped from set v2. Thanks. > Now I need to be able to recognize such cases elsewhere. I'm going > back though other patches in this set looking for that, but I'm not > so sure I would recognize it. > > Jonathan & all, Any hints on the rule of regmap? You may check how the regmap is initialized. When it is retrieved by phandle from device tree, then you might be almost sure that it refers to the different device. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland