mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
ASoC: codecs: rv1106_codec: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data in a single step. Change-Id: I713eea70b5fc6751a2b1f9cbd1334a5cd32d2611 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/reset.h>
|
||||
@@ -2131,7 +2132,6 @@ MODULE_DEVICE_TABLE(of, rv1106_codec_of_match);
|
||||
|
||||
static int rv1106_platform_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *of_id;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct rv1106_codec_priv *rv1106;
|
||||
struct resource *res;
|
||||
@@ -2142,9 +2142,7 @@ static int rv1106_platform_probe(struct platform_device *pdev)
|
||||
if (!rv1106)
|
||||
return -ENOMEM;
|
||||
|
||||
of_id = of_match_device(rv1106_codec_of_match, &pdev->dev);
|
||||
if (of_id)
|
||||
rv1106->soc_id = (enum soc_id_e)of_id->data;
|
||||
rv1106->soc_id = (enum soc_id_e)device_get_match_data(&pdev->dev);
|
||||
dev_info(&pdev->dev, "current soc_id: rv%x\n", rv1106->soc_id);
|
||||
|
||||
rv1106->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
|
||||
|
||||
Reference in New Issue
Block a user