[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151026102834.GE25308@pengutronix.de>
Date: Mon, 26 Oct 2015 11:28:34 +0100
From: Sascha Hauer <s.hauer@...gutronix.de>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: andrew-ct.chen@...iatek.com,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Matthias Brugger <matthias.bgg@...il.com>,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
srv_heupstream@...iatek.com
Subject: Re: [PATCH 2/3] nvmem: mediatek: Add Mediatek EFUSE driver
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
putting a second qcom,qfprom node into the device tree to break the
driver.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists