mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev
Subsystems (3)
PATCH 1/2 mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev
They are never get changed, make them constant.
While at it, fix indent as well.
Signed-off-by Axel Lin <[email protected]>
--- drivers/mfd/at91-usart.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/mfd/at91-usart.c +8 -8
@@ -15,15 +15,15 @@#include <linux/of.h> #include <linux/property.h> -static struct mfd_cell at91_usart_spi_subdev = { - .name ="at91_usart_spi" , - .of_compatible ="microchip,at91sam9g45-usart-spi" , - }; +static const struct mfd_cell at91_usart_spi_subdev = { + .name ="at91_usart_spi" , + .of_compatible ="microchip,at91sam9g45-usart-spi" , +}; -static struct mfd_cell at91_usart_serial_subdev = { - .name ="atmel_usart_serial" , - .of_compatible ="atmel,at91rm9200-usart-serial" , - }; +static const struct mfd_cell at91_usart_serial_subdev = { + .name ="atmel_usart_serial" , + .of_compatible ="atmel,at91rm9200-usart-serial" , +};static int at91_usart_mode_probe (struct platform_device *pdev) {
Signature · 1 line
2.17.1
PATCH 2/2 mfd: at91-usart: No need to copy mfd_cell in probe
Use pointer instead.
Signed-off-by Axel Lin <[email protected]>
--- drivers/mfd/at91-usart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/at91-usart.c +4 -4
@@ -27,17 +27,17 @@ static const struct mfd_cell at91_usart_serial_subdev = {static int at91_usart_mode_probe (struct platform_device *pdev) { -struct mfd_cell cell; +const struct mfd_cell *cell;u32 opmode =AT91_USART_MODE_SERIAL ;device_property_read_u32 (&pdev->dev,"atmel,usart-mode" , &opmode);switch (opmode) {case AT91_USART_MODE_SPI : - cell = at91_usart_spi_subdev; + cell = &at91_usart_spi_subdev;break ;case AT91_USART_MODE_SERIAL : - cell = at91_usart_serial_subdev; + cell = &at91_usart_serial_subdev;break ;default : dev_err(&pdev->dev, "atmel,usart-mode has an invalid value %u\n",
@@ -45,7 +45,7 @@ static int at91_usart_mode_probe(struct platform_device *pdev)return -EINVAL ; } -return devm_mfd_add_devices (&pdev->dev,PLATFORM_DEVID_AUTO , &cell,1 , +return devm_mfd_add_devices (&pdev->dev,PLATFORM_DEVID_AUTO , cell,1 ,NULL ,0 ,NULL ); }
Signature · 1 line
2.17.1
Lee Jones
AppliedRe: [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe
Quoted 6 lines · Axel Lin
Use pointer instead.
Signed-off-by Axel Lin <[email protected]>--- drivers/mfd/at91-usart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedQuoted 7 lines · Axel Lin
They are never get changed, make them constant.
While at it, fix indent as well.Signed-off-by Axel Lin <[email protected]>--- drivers/mfd/at91-usart.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog