On Mon, Dec 03, 2018 at 11:15:51AM +0800, Jay Fang wrote: > -static int of_spi_register_master(struct spi_controller *ctlr) > -{ > + if (IS_ENABLED(CONFIG_OF) && np) { > + for (i = 0; i < nb; i++) > + cs[i] = of_get_named_gpio(np, "cs-gpios", i); > + } else if (IS_ENABLED(CONFIG_ACPI) && ACPI_HANDLE(&ctlr->dev)) { > + for (i = 0; i < nb; i++) { > + desc = devm_gpiod_get_index(&ctlr->dev, "cs", > + i, GPIOD_ASIS); > + if (IS_ERR(desc)) > + continue; > + cs[i] = desc_to_gpio(desc); > + } > + } > return 0; Given that both properties are called "cs" won't devm_gpiod_get_index() do the right thing for DT systems as well as ACPI allowing us to move entirely to descriptors and remove the need for separate code paths here?
Attachment:
signature.asc
Description: PGP signature