[PATCH 05/10] PCI: exynos: Add structure to hold resource operations
Krzysztof Kozlowski
krzk at kernel.org
Wed May 21 02:42:37 PDT 2025
On Mon, May 19, 2025 at 01:01:47AM GMT, Shradha Todi wrote:
> +struct samsung_res_ops {
> + int (*init_regulator)(struct exynos_pcie *ep);
> + irqreturn_t (*pcie_irq_handler)(int irq, void *arg);
> };
>
> static void exynos_pcie_writel(void __iomem *base, u32 val, u32 reg)
> @@ -74,6 +81,36 @@ static u32 exynos_pcie_readl(void __iomem *base, u32 reg)
> return readl(base + reg);
> }
>
> +static int samsung_regulator_enable(struct exynos_pcie *ep)
> +{
> + struct device *dev = ep->pci.dev;
> + int ret;
> +
> + if (ep->supplies_cnt == 0)
> + return 0;
> +
> + ret = devm_regulator_bulk_get(dev, ep->supplies_cnt, ep->supplies);
No. Getting resources on every enable is making this much less readable.
NAK
Best regards,
Krzysztof
More information about the linux-arm-kernel
mailing list