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

Commit 5b46ac3a authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Linus Walleij
Browse files

sh-pfc: Rename sh_pfc window field to windows



There's more than one window, name the field windows.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent de55c71f
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -34,20 +34,21 @@ static int sh_pfc_ioremap(struct sh_pfc *pfc, struct platform_device *pdev)
	if (pdev->num_resources == 0)
		return -EINVAL;

	pfc->window = devm_kzalloc(pfc->dev, pdev->num_resources *
				   sizeof(*pfc->window), GFP_NOWAIT);
	if (!pfc->window)
	pfc->windows = devm_kzalloc(pfc->dev, pdev->num_resources *
				    sizeof(*pfc->windows), GFP_NOWAIT);
	if (!pfc->windows)
		return -ENOMEM;

	pfc->num_windows = pdev->num_resources;

	for (k = 0, res = pdev->resource; k < pdev->num_resources; k++, res++) {
		WARN_ON(resource_type(res) != IORESOURCE_MEM);
		pfc->window[k].phys = res->start;
		pfc->window[k].size = resource_size(res);
		pfc->window[k].virt = devm_ioremap_nocache(pfc->dev, res->start,
		pfc->windows[k].phys = res->start;
		pfc->windows[k].size = resource_size(res);
		pfc->windows[k].virt =
			devm_ioremap_nocache(pfc->dev, res->start,
					     resource_size(res));
		if (!pfc->window[k].virt)
		if (!pfc->windows[k].virt)
			return -ENOMEM;
	}

@@ -62,7 +63,7 @@ static void __iomem *sh_pfc_phys_to_virt(struct sh_pfc *pfc,

	/* scan through physical windows and convert address */
	for (i = 0; i < pfc->num_windows; i++) {
		window = pfc->window + i;
		window = pfc->windows + i;

		if (address < window->phys)
			continue;
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ struct sh_pfc {
	spinlock_t lock;

	unsigned int num_windows;
	struct sh_pfc_window *window;
	struct sh_pfc_window *windows;

	struct sh_pfc_pin_range *ranges;
	unsigned int nr_ranges;
+2 −2
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
	 * GPIOs.
	 */
	for (i = 0; i < pfc->num_windows; ++i) {
		struct sh_pfc_window *window = &pfc->window[i];
		struct sh_pfc_window *window = &pfc->windows[i];

		if (pfc->info->data_regs[0].reg >= window->phys &&
		    pfc->info->data_regs[0].reg < window->phys + window->size)
@@ -358,7 +358,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
		return 0;

	/* Register the real GPIOs chip. */
	chip = sh_pfc_add_gpiochip(pfc, gpio_pin_setup, &pfc->window[i]);
	chip = sh_pfc_add_gpiochip(pfc, gpio_pin_setup, &pfc->windows[i]);
	if (IS_ERR(chip))
		return PTR_ERR(chip);

+2 −2
Original line number Diff line number Diff line
@@ -2680,7 +2680,7 @@ static unsigned int r8a73a4_pinmux_get_bias(struct sh_pfc *pfc,
{
	void __iomem *addr;

	addr = pfc->window->virt + r8a73a4_portcr_offsets[pin >> 5] + pin;
	addr = pfc->windows->virt + r8a73a4_portcr_offsets[pin >> 5] + pin;

	switch (ioread8(addr) & PORTCR_PULMD_MASK) {
	case PORTCR_PULMD_UP:
@@ -2699,7 +2699,7 @@ static void r8a73a4_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
	void __iomem *addr;
	u32 value;

	addr = pfc->window->virt + r8a73a4_portcr_offsets[pin >> 5] + pin;
	addr = pfc->windows->virt + r8a73a4_portcr_offsets[pin >> 5] + pin;
	value = ioread8(addr) & ~PORTCR_PULMD_MASK;

	switch (bias) {
+1 −1
Original line number Diff line number Diff line
@@ -3710,7 +3710,7 @@ static void __iomem *r8a7740_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin)
			&r8a7740_portcr_offsets[i];

		if (i <= group->end_pin)
			return pfc->window->virt + group->offset + pin;
			return pfc->windows->virt + group->offset + pin;
	}

	return NULL;
Loading