Re: [PATCH 2/2] spi: cadence-quadspi: Add support for OSPI device reset

From: Mark Brown
Date: Tue Apr 05 2022 - 20:42:15 EST


On Tue, Apr 05, 2022 at 04:30:37PM +0530, Sai Krishna Potthuri wrote:

> +static int cqspi_versal_device_reset(struct cqspi_st *cqspi)
> +{
> + struct platform_device *pdev = cqspi->pdev;
> + int ret;
> + int gpio;
> + enum of_gpio_flags flags;
> +
> + gpio = of_get_named_gpio_flags(pdev->dev.of_node,
> + "reset-gpios", 0, &flags);
> + if (!gpio_is_valid(gpio))
> + return gpio;
> +
> + ret = devm_gpio_request_one(&pdev->dev, gpio, flags,
> + "flash-reset");

You should use the gpiod APIs here which should mean you don't need any
DT specific code to parse the flags. At some point the old GPIO APIs
will be removed.

Attachment: signature.asc
Description: PGP signature