From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753833AbbJZKj4 (ORCPT ); Mon, 26 Oct 2015 06:39:56 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:32951 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753669AbbJZKjz (ORCPT ); Mon, 26 Oct 2015 06:39:55 -0400 Message-ID: <562E02F2.50709@linaro.org> Date: Mon, 26 Oct 2015 10:39:46 +0000 From: Srinivas Kandagatla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Sascha Hauer CC: andrew-ct.chen@mediatek.com, Maxime Ripard , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, srv_heupstream@mediatek.com Subject: Re: [PATCH 2/3] nvmem: mediatek: Add Mediatek EFUSE driver References: <1444984751-4572-1-git-send-email-andrew-ct.chen@mediatek.com> <1444984751-4572-3-git-send-email-andrew-ct.chen@mediatek.com> <562DF8C8.8060600@linaro.org> <20151026102834.GE25308@pengutronix.de> In-Reply-To: <20151026102834.GE25308@pengutronix.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/15 10:28, Sascha Hauer wrote: > On Mon, Oct 26, 2015 at 09:56:24AM +0000, Srinivas Kandagatla wrote: >>> + .val_bits = 32, >>> + .reg_stride = 4, >>> +}; >>> + >>> +static int mtk_efuse_probe(struct platform_device *pdev) >>> +{ >>> + struct device *dev = &pdev->dev; >>> + struct resource *res; >>> + struct nvmem_device *nvmem; >>> + struct nvmem_config *econfig; >>> + struct regmap *regmap; >>> + void __iomem *base; >>> + >>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >>> + base = devm_ioremap_resource(dev, res); >>> + if (IS_ERR(base)) >>> + return PTR_ERR(base); >>> + >>> + econfig = devm_kzalloc(dev, sizeof(*econfig), GFP_KERNEL); >>> + if (!econfig) >>> + return -ENOMEM; >> Why not use static econfig variable? > > Because drivers should not assume there is only one instance of them in > the system. The qfprom driver does this and it's only a matter of Good point, Yes, you are right. If MTK has possibility of having more than one efuse we can leave the code as it is. > putting a second qcom,qfprom node into the device tree to break the > driver. It would indeed. --srini > > Sascha >