Re: [PATCH v2 02/13] spi: Replace all spi->chip_select and spi->cs_gpiod references with function call
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v2 02/13] spi: Replace all spi->chip_select and spi->cs_gpiod references with function call
- From: Cédric Le Goater <clg@xxxxxxxx>
- Date: Mon, 23 Jan 2023 14:10:05 +0100
- Cc: <git@xxxxxxx>, <linux-spi@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <joel@xxxxxxxxx>, <andrew@xxxxxxxx>, <radu_nicolae.pirea@xxxxxx>, <nicolas.ferre@xxxxxxxxxxxxx>, <alexandre.belloni@xxxxxxxxxxx>, <claudiu.beznea@xxxxxxxxxxxxx>, <bcm-kernel-feedback-list@xxxxxxxxxxxx>, <fancer.lancer@xxxxxxxxx>, <kernel@xxxxxxxxxxxxxx>, <festevam@xxxxxxxxx>, <linux-imx@xxxxxxx>, <jbrunet@xxxxxxxxxxxx>, <martin.blumenstingl@xxxxxxxxxxxxxx>, <avifishman70@xxxxxxxxx>, <tmaimon77@xxxxxxxxx>, <tali.perry1@xxxxxxxxx>, <venture@xxxxxxxxxx>, <yuenn@xxxxxxxxxx>, <benjaminfair@xxxxxxxxxx>, <yogeshgaur.83@xxxxxxxxx>, <konrad.dybcio@xxxxxxxxxxxxxx>, <alim.akhtar@xxxxxxxxxxx>, <ldewangan@xxxxxxxxxx>, <michal.simek@xxxxxxx>, <linux-aspeed@xxxxxxxxxxxxxxxx>, <openbmc@xxxxxxxxxxxxxxxx>, <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-amlogic@xxxxxxxxxxxxxxxxxxx>, <linux-mediatek@xxxxxxxxxxxxxxxxxxx>, <linux-arm-msm@xxxxxxxxxxxxxxx>, <linux-rockchip@xxxxxxxxxxxxxxxxxxx>, <linux-samsung-soc@xxxxxxxxxxxxxxx>, <linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, <linux-sunxi@xxxxxxxxxxxxxxx>, <linux-tegra@xxxxxxxxxxxxxxx>, <netdev@xxxxxxxxxxxxxxx>, <linux-wpan@xxxxxxxxxxxxxxx>, <libertas-dev@xxxxxxxxxxxxxxxxxxx>, <linux-wireless@xxxxxxxxxxxxxxx>, <linux-mtd@xxxxxxxxxxxxxxxxxxx>, <lars@xxxxxxxxxx>, <Michael.Hennerich@xxxxxxxxxx>, <linux-iio@xxxxxxxxxxxxxxx>, <michael@xxxxxxxx>, <palmer@xxxxxxxxxxx>, <linux-riscv@xxxxxxxxxxxxxxxxxxx>, <linux-media@xxxxxxxxxxxxxxx>, <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, <greybus-dev@xxxxxxxxxxxxxxxx>, <linux-staging@xxxxxxxxxxxxxxx>, <amitrkcian2002@xxxxxxxxx>
- In-reply-to: <20230119185342.2093323-3-amit.kumar-mahapatra@amd.com>
- References: <20230119185342.2093323-1-amit.kumar-mahapatra@amd.com> <20230119185342.2093323-3-amit.kumar-mahapatra@amd.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0
On 1/19/23 19:53, Amit Kumar Mahapatra wrote:
diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
index 873ff2cf72c9..b7a9ec550ba1 100644
--- a/drivers/spi/spi-aspeed-smc.c
+++ b/drivers/spi/spi-aspeed-smc.c
@@ -296,7 +296,7 @@ static const struct aspeed_spi_data ast2400_spi_data;
static int do_aspeed_spi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
{
struct aspeed_spi *aspi = spi_controller_get_devdata(mem->spi->master);
- struct aspeed_spi_chip *chip = &aspi->chips[mem->spi->chip_select];
+ struct aspeed_spi_chip *chip = &aspi->chips[spi_get_chipselect(mem->spi, 0)];
u32 addr_mode, addr_mode_backup;
u32 ctl_val;
int ret = 0;
@@ -377,7 +377,8 @@ static const char *aspeed_spi_get_name(struct spi_mem *mem)
struct aspeed_spi *aspi = spi_controller_get_devdata(mem->spi->master);
struct device *dev = aspi->dev;
- return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev), mem->spi->chip_select);
+ return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev),
+ spi_get_chipselect(mem->spi, 0));
}
struct aspeed_spi_window {
@@ -553,7 +554,7 @@ static int aspeed_spi_do_calibration(struct aspeed_spi_chip *chip);
static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)
{
struct aspeed_spi *aspi = spi_controller_get_devdata(desc->mem->spi->master);
- struct aspeed_spi_chip *chip = &aspi->chips[desc->mem->spi->chip_select];
+ struct aspeed_spi_chip *chip = &aspi->chips[spi_get_chipselect(desc->mem->spi, 0)];
struct spi_mem_op *op = &desc->info.op_tmpl;
u32 ctl_val;
int ret = 0;
@@ -620,7 +621,7 @@ static ssize_t aspeed_spi_dirmap_read(struct spi_mem_dirmap_desc *desc,
u64 offset, size_t len, void *buf)
{
struct aspeed_spi *aspi = spi_controller_get_devdata(desc->mem->spi->master);
- struct aspeed_spi_chip *chip = &aspi->chips[desc->mem->spi->chip_select];
+ struct aspeed_spi_chip *chip = &aspi->chips[spi_get_chipselect(desc->mem->spi, 0)];
/* Switch to USER command mode if mapping window is too small */
if (chip->ahb_window_size < offset + len) {
@@ -670,7 +671,7 @@ static int aspeed_spi_setup(struct spi_device *spi)
{
struct aspeed_spi *aspi = spi_controller_get_devdata(spi->master);
const struct aspeed_spi_data *data = aspi->data;
- unsigned int cs = spi->chip_select;
+ unsigned int cs = spi_get_chipselect(spi, 0);
struct aspeed_spi_chip *chip = &aspi->chips[cs];
chip->aspi = aspi;
@@ -697,7 +698,7 @@ static int aspeed_spi_setup(struct spi_device *spi)
static void aspeed_spi_cleanup(struct spi_device *spi)
{
struct aspeed_spi *aspi = spi_controller_get_devdata(spi->master);
- unsigned int cs = spi->chip_select;
+ unsigned int cs = spi_get_chipselect(spi, 0);
aspeed_spi_chip_enable(aspi, cs, false);
For the Aspeed driver,
Reviewed-by: Cédric Le Goater <clg@xxxxxxxx>
Thanks,
C.
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|