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

Commit 1a8764f4 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij
Browse files

pinctrl: single: use of_device_get_match_data() to get soc data



Use of_device_get_match_data() instead of of_match_device().
It allows us to remove the forward declaration of pcs_of_match.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 80fbc2d9
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -1270,8 +1270,6 @@ static void pcs_free_resources(struct pcs_device *pcs)
#endif
#endif
}
}


static const struct of_device_id pcs_of_match[];

static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs)
static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs)
{
{
	const char *propname = "pinctrl-single,gpio-range";
	const char *propname = "pinctrl-single,gpio-range";
@@ -1637,15 +1635,14 @@ static int pcs_quirk_missing_pinctrl_cells(struct pcs_device *pcs,
static int pcs_probe(struct platform_device *pdev)
static int pcs_probe(struct platform_device *pdev)
{
{
	struct device_node *np = pdev->dev.of_node;
	struct device_node *np = pdev->dev.of_node;
	const struct of_device_id *match;
	struct pcs_pdata *pdata;
	struct pcs_pdata *pdata;
	struct resource *res;
	struct resource *res;
	struct pcs_device *pcs;
	struct pcs_device *pcs;
	const struct pcs_soc_data *soc;
	const struct pcs_soc_data *soc;
	int ret;
	int ret;


	match = of_match_device(pcs_of_match, &pdev->dev);
	soc = of_device_get_match_data(&pdev->dev);
	if (!match)
	if (WARN_ON(!soc))
		return -EINVAL;
		return -EINVAL;


	pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL);
	pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL);
@@ -1658,7 +1655,6 @@ static int pcs_probe(struct platform_device *pdev)
	raw_spin_lock_init(&pcs->lock);
	raw_spin_lock_init(&pcs->lock);
	mutex_init(&pcs->mutex);
	mutex_init(&pcs->mutex);
	INIT_LIST_HEAD(&pcs->gpiofuncs);
	INIT_LIST_HEAD(&pcs->gpiofuncs);
	soc = match->data;
	pcs->flags = soc->flags;
	pcs->flags = soc->flags;
	memcpy(&pcs->socdata, soc, sizeof(*soc));
	memcpy(&pcs->socdata, soc, sizeof(*soc));