nfc: constify passed nfc_dev

The struct nfc_dev is not modified by nfc_get_drvdata() and
nfc_device_name() so it can be made a const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Krzysztof Kozlowski 2021-07-29 12:40:11 +02:00 committed by David S. Miller
parent 8cb79af5c6
commit dd8987a394

View File

@ -245,7 +245,7 @@ static inline void nfc_set_drvdata(struct nfc_dev *dev, void *data)
* *
* @dev: The nfc device * @dev: The nfc device
*/ */
static inline void *nfc_get_drvdata(struct nfc_dev *dev) static inline void *nfc_get_drvdata(const struct nfc_dev *dev)
{ {
return dev_get_drvdata(&dev->dev); return dev_get_drvdata(&dev->dev);
} }
@ -255,7 +255,7 @@ static inline void *nfc_get_drvdata(struct nfc_dev *dev)
* *
* @dev: The nfc device whose name to return * @dev: The nfc device whose name to return
*/ */
static inline const char *nfc_device_name(struct nfc_dev *dev) static inline const char *nfc_device_name(const struct nfc_dev *dev)
{ {
return dev_name(&dev->dev); return dev_name(&dev->dev);
} }