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

Commit 65b22ad9 authored by Dale Farnsworth's avatar Dale Farnsworth Committed by Jean Delvare
Browse files

i2c-mv64xxx: Use i2c_add_numbered_adapter



Convert the Marvell mv64xxx I2C driver to use the new i2c infrastructure,
by calling i2c_add_numbered_adapter().  This allows clients to be
registered before the bus is instantiated.

Signed-off-by: default avatarDale Farnsworth <dale@farnsworth.org>
Acked-by: default avatarMark A. Greer <mgreer@mvista.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent c29c2221
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -527,6 +527,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
	drv_data->adapter.class = I2C_CLASS_HWMON;
	drv_data->adapter.class = I2C_CLASS_HWMON;
	drv_data->adapter.timeout = pdata->timeout;
	drv_data->adapter.timeout = pdata->timeout;
	drv_data->adapter.retries = pdata->retries;
	drv_data->adapter.retries = pdata->retries;
	drv_data->adapter.nr = pd->id;
	platform_set_drvdata(pd, drv_data);
	platform_set_drvdata(pd, drv_data);
	i2c_set_adapdata(&drv_data->adapter, drv_data);
	i2c_set_adapdata(&drv_data->adapter, drv_data);


@@ -539,7 +540,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
			drv_data->irq);
			drv_data->irq);
		rc = -EINVAL;
		rc = -EINVAL;
		goto exit_unmap_regs;
		goto exit_unmap_regs;
	} else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) {
	} else if ((rc = i2c_add_numbered_adapter(&drv_data->adapter)) != 0) {
		dev_err(&drv_data->adapter.dev,
		dev_err(&drv_data->adapter.dev,
			"mv64xxx: Can't add i2c adapter, rc: %d\n", -rc);
			"mv64xxx: Can't add i2c adapter, rc: %d\n", -rc);
		goto exit_free_irq;
		goto exit_free_irq;