reset-microchip-sparx5.c (453ed4283bebd0776682c5a3227619d92caa9c8c) reset-microchip-sparx5.c (91105ed604e4ea7075a35a1ef8bc1782d347290e)
1// SPDX-License-Identifier: GPL-2.0+
2/* Microchip Sparx5 Switch Reset driver
3 *
4 * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.
5 *
6 * The Sparx5 Chip Register Model can be browsed at this location:
7 * https://github.com/microchip-ung/sparx-5_reginfo
8 */

--- 68 unchanged lines hidden (view full) ---

77static int mchp_sparx5_map_io(struct platform_device *pdev, int index,
78 struct regmap **target)
79{
80 struct resource *res;
81 struct regmap *map;
82 void __iomem *mem;
83
84 mem = devm_platform_get_and_ioremap_resource(pdev, index, &res);
1// SPDX-License-Identifier: GPL-2.0+
2/* Microchip Sparx5 Switch Reset driver
3 *
4 * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.
5 *
6 * The Sparx5 Chip Register Model can be browsed at this location:
7 * https://github.com/microchip-ung/sparx-5_reginfo
8 */

--- 68 unchanged lines hidden (view full) ---

77static int mchp_sparx5_map_io(struct platform_device *pdev, int index,
78 struct regmap **target)
79{
80 struct resource *res;
81 struct regmap *map;
82 void __iomem *mem;
83
84 mem = devm_platform_get_and_ioremap_resource(pdev, index, &res);
85 if (!mem) {
85 if (IS_ERR(mem)) {
86 dev_err(&pdev->dev, "Could not map resource %d\n", index);
86 dev_err(&pdev->dev, "Could not map resource %d\n", index);
87 return -ENXIO;
87 return PTR_ERR(mem);
88 }
89 sparx5_reset_regmap_config.name = res->name;
90 map = devm_regmap_init_mmio(&pdev->dev, mem, &sparx5_reset_regmap_config);
91 if (IS_ERR(map))
92 return PTR_ERR(map);
93 *target = map;
94 return 0;
95}

--- 51 unchanged lines hidden ---
88 }
89 sparx5_reset_regmap_config.name = res->name;
90 map = devm_regmap_init_mmio(&pdev->dev, mem, &sparx5_reset_regmap_config);
91 if (IS_ERR(map))
92 return PTR_ERR(map);
93 *target = map;
94 return 0;
95}

--- 51 unchanged lines hidden ---