mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
i2c: s3c2410: simplify getting of_device_id match data
Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
28fb89ff97
commit
af92cca171
1 changed files with 3 additions and 6 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
|
@ -156,12 +157,8 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
|
|||
*/
|
||||
static inline kernel_ulong_t s3c24xx_get_device_quirks(struct platform_device *pdev)
|
||||
{
|
||||
if (pdev->dev.of_node) {
|
||||
const struct of_device_id *match;
|
||||
|
||||
match = of_match_node(s3c24xx_i2c_match, pdev->dev.of_node);
|
||||
return (kernel_ulong_t)match->data;
|
||||
}
|
||||
if (pdev->dev.of_node)
|
||||
return (kernel_ulong_t)of_device_get_match_data(&pdev->dev);
|
||||
|
||||
return platform_get_device_id(pdev)->driver_data;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue