Unverified Commit 5d22a618 authored by Corentin Labbe's avatar Corentin Labbe Committed by Maxime Ripard
Browse files

clk: sunxi: use of_device_get_match_data



The usage of of_device_get_match_data reduce the code size a bit.

Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
parent e42617b8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
{
	struct device_node *np = pdev->dev.of_node;
	struct clk_onecell_data *clk_data;
	const struct of_device_id *device;
	const struct gates_data *data;
	const char *clk_parent;
	const char *clk_name;
@@ -50,10 +49,9 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
	if (!np)
		return -ENODEV;

	device = of_match_device(sun6i_a31_apb0_gates_clk_dt_ids, &pdev->dev);
	if (!device)
	data = of_device_get_match_data(&pdev->dev);
	if (!data)
		return -ENODEV;
	data = device->data;

	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	reg = devm_ioremap_resource(&pdev->dev, r);