Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5063f16 authored by Ganesan Ramalingam's avatar Ganesan Ramalingam Committed by Wolfram Sang
Browse files

i2c: ocores: register OF i2c devices



Call of_i2c_register_devices() in probe function to register i2c devices
specified in the device tree or OF.

Signed-off-by: default avatarGanesan Ramalingam <ganesanr@broadcom.com>
Signed-off-by: default avatarJayachandran C <jayachandranc@netlogicmicro.com>

[wsa: add proper braces]

Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent c889e91d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@
#include <linux/i2c-ocores.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/of_i2c.h>

struct ocores_i2c {
	void __iomem *base;
@@ -343,6 +344,8 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
	if (pdata) {
		for (i = 0; i < pdata->num_devices; i++)
			i2c_new_device(&i2c->adap, pdata->devices + i);
	} else {
		of_i2c_register_devices(&i2c->adap);
	}

	return 0;