serial: stm32: Use of_device_get_match_data()
authorStephen Boyd <swboyd@chromium.org>
Sat, 23 Jan 2021 03:44:25 +0000 (19:44 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:07 +0000 (09:50 +0200)
commitb5e8f0adaec1899ba91c46498adc13c96fcb3663
tree4747d7c873ff564786e2cae5d9a5b86be6565647
parent379b007b57ca8bac6e07f99cc3d8335e6ea73348
serial: stm32: Use of_device_get_match_data()

[ Upstream commit d825f0bea20f49a8f413a6acd7c4100ea55edf6d ]

This driver casts away the constness of struct stm32_usart_info that is
pointed to by the of match table. Use of_device_get_match_data() instead
of of_match_device() here and push the const throughout the code so that
we don't cast away const. This nicely avoids referencing the match table
when it is undefined with configurations where CONFIG_OF=n and fixes the
const issues.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: <linux-serial@vger.kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210123034428.2841052-4-swboyd@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/stm32-usart.c
drivers/tty/serial/stm32-usart.h