nfc: constify passed nfc_dev
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 29 Jul 2021 10:40:11 +0000 (12:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Jul 2021 11:28:02 +0000 (12:28 +0100)
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>
include/net/nfc/nfc.h

index 85b6987..9017791 100644 (file)
@@ -245,7 +245,7 @@ static inline void nfc_set_drvdata(struct nfc_dev *dev, void *data)
  *
  * @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);
 }
@@ -255,7 +255,7 @@ static inline void *nfc_get_drvdata(struct nfc_dev *dev)
  *
  * @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);
 }