Thread (15 messages) 15 messages, 3 authors, 2015-10-27

[PATCH 2/3] nvmem: mediatek: Add Mediatek EFUSE driver

From: Srinivas Kandagatla <hidden>
Date: 2015-10-26 10:39:56
Also in: linux-devicetree, linux-mediatek, lkml


On 26/10/15 10:28, Sascha Hauer wrote:
On Mon, Oct 26, 2015 at 09:56:24AM +0000, Srinivas Kandagatla wrote:
quoted
quoted
+	.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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help