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

Commit b371f866 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Wolfram Sang
Browse files

i2c: exynos5: use core helper to get driver data



Driver core provides of_device_get_match_data which can be used
to get driver data instead of custom helper.

Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 70c8c4e9
Loading
Loading
Loading
Loading
+3 −12
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>


@@ -201,7 +202,7 @@ struct exynos5_i2c {
	unsigned int		op_clock;
	unsigned int		op_clock;


	/* Version of HS-I2C Hardware */
	/* Version of HS-I2C Hardware */
	struct exynos_hsi2c_variant	*variant;
	const struct exynos_hsi2c_variant *variant;
};
};


/**
/**
@@ -247,15 +248,6 @@ static const struct of_device_id exynos5_i2c_match[] = {
};
};
MODULE_DEVICE_TABLE(of, exynos5_i2c_match);
MODULE_DEVICE_TABLE(of, exynos5_i2c_match);


static inline struct exynos_hsi2c_variant *exynos5_i2c_get_variant
					(struct platform_device *pdev)
{
	const struct of_device_id *match;

	match = of_match_node(exynos5_i2c_match, pdev->dev.of_node);
	return (struct exynos_hsi2c_variant *)match->data;
}

static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c)
static void exynos5_i2c_clr_pend_irq(struct exynos5_i2c *i2c)
{
{
	writel(readl(i2c->regs + HSI2C_INT_STATUS),
	writel(readl(i2c->regs + HSI2C_INT_STATUS),
@@ -774,8 +766,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
		goto err_clk;
		goto err_clk;
	}
	}


	/* Need to check the variant before setting up. */
	i2c->variant = of_device_get_match_data(&pdev->dev);
	i2c->variant = exynos5_i2c_get_variant(pdev);


	ret = exynos5_hsi2c_clock_setup(i2c);
	ret = exynos5_hsi2c_clock_setup(i2c);
	if (ret)
	if (ret)