doc: Apply constant qualifier on device instance where relevant

s/struct device */const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
diff --git a/doc/guides/design_guidelines.rst b/doc/guides/design_guidelines.rst
index 6192d43..42413b4 100644
--- a/doc/guides/design_guidelines.rst
+++ b/doc/guides/design_guidelines.rst
@@ -53,7 +53,7 @@
 * The requirements of :c:type:`counter_alarm_callback_t` invoked when a
   counter device alarm fires are satisfied by::
 
-    void handle_alarm(struct device *dev,
+    void handle_alarm(const struct device *dev,
                       uint8_t chan_id,
 		      uint32_t ticks,
 		      void *user_data)
diff --git a/doc/guides/dts/howtos.rst b/doc/guides/dts/howtos.rst
index 104724b..9fb357a 100644
--- a/doc/guides/dts/howtos.rst
+++ b/doc/guides/dts/howtos.rst
@@ -375,8 +375,8 @@
    };
 
    /* Implement driver API functions (drivers/some_api.h callbacks): */
-   static int my_driver_api_func1(struct device *dev, uint32_t *foo) { /* ... */ }
-   static int my_driver_api_func2(struct device *dev, uint64_t bar) { /* ... */ }
+   static int my_driver_api_func1(const struct device *dev, uint32_t *foo) { /* ... */ }
+   static int my_driver_api_func2(const struct device *dev, uint64_t bar) { /* ... */ }
    static struct some_api my_api_funcs = {
    	.func1 = my_driver_api_func1,
    	.func2 = my_driver_api_func2,
diff --git a/doc/reference/drivers/index.rst b/doc/reference/drivers/index.rst
index 2cd31e6..20f03c4 100644
--- a/doc/reference/drivers/index.rst
+++ b/doc/reference/drivers/index.rst
@@ -134,15 +134,15 @@
 
 .. code-block:: C
 
-  typedef int (*subsystem_do_this_t)(struct device *device, int foo, int bar);
-  typedef void (*subsystem_do_that_t)(struct device *device, void *baz);
+  typedef int (*subsystem_do_this_t)(const struct device *device, int foo, int bar);
+  typedef void (*subsystem_do_that_t)(const struct device *device, void *baz);
 
   struct subsystem_api {
         subsystem_do_this_t do_this;
         subsystem_do_that_t do_that;
   };
 
-  static inline int subsystem_do_this(struct device *device, int foo, int bar)
+  static inline int subsystem_do_this(const struct device *device, int foo, int bar)
   {
         struct subsystem_api *api;
 
@@ -150,7 +150,7 @@
         return api->do_this(device, foo, bar);
   }
 
-  static inline void subsystem_do_that(struct device *device, void *baz)
+  static inline void subsystem_do_that(const struct device *device, void *baz)
   {
         struct subsystem_api *api;
 
@@ -163,12 +163,12 @@
 
 .. code-block:: C
 
-  static int my_driver_do_this(struct device *device, int foo, int bar)
+  static int my_driver_do_this(const struct device *device, int foo, int bar)
   {
         ...
   }
 
-  static void my_driver_do_that(struct device *device, void *baz)
+  static void my_driver_do_that(const struct device *device, void *baz)
   {
         ...
   }
@@ -205,10 +205,10 @@
    #include <drivers/subsystem.h>
 
    /* When extensions need not be invoked from user mode threads */
-   int specific_do_that(struct device *device, int foo);
+   int specific_do_that(const struct device *device, int foo);
 
    /* When extensions must be invokable from user mode threads */
-   __syscall int specific_from_user(struct device *device, int bar);
+   __syscall int specific_from_user(const struct device *device, int bar);
 
    /* Only needed when extensions include syscalls */
    #include <syscalls/specific.h>
@@ -218,7 +218,7 @@
 
 .. code-block:: C
 
-   static int generic_do_this(struct device *device, void *arg)
+   static int generic_do_this(const struct device *device, void *arg)
    {
       ...
    }
@@ -230,13 +230,13 @@
    };
 
    /* supervisor-only API is globally visible */
-   int specific_do_that(struct device *device, int foo)
+   int specific_do_that(const struct device *device, int foo)
    {
       ...
    }
 
    /* syscall API passes through a translation */
-   int z_impl_specific_from_user(struct device *device, int bar)
+   int z_impl_specific_from_user(const struct device *device, int bar)
    {
       ...
    }
@@ -245,7 +245,7 @@
 
    #include <syscall_handler.h>
 
-   int z_vrfy_specific_from_user(struct device *device, int bar)
+   int z_vrfy_specific_from_user(const struct device *device, int bar)
    {
        Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_GENERIC, &api));
        return z_impl_specific_do_that(device, bar)
@@ -281,7 +281,7 @@
 
 .. code-block:: C
 
-  typedef void (*my_driver_config_irq_t)(struct device *device);
+  typedef void (*my_driver_config_irq_t)(const struct device *device);
 
   struct my_driver_config {
         DEVICE_MMIO_ROM;
@@ -292,13 +292,13 @@
 
 .. code-block:: C
 
-  void my_driver_isr(struct device *device)
+  void my_driver_isr(const struct device *device)
   {
         /* Handle interrupt */
         ...
   }
 
-  int my_driver_init(struct device *device)
+  int my_driver_init(const struct device *device)
   {
         const struct my_driver_config *config = device->config;
 
@@ -471,14 +471,14 @@
       ...
    }
 
-   int my_driver_init(struct device *device)
+   int my_driver_init(const struct device *device)
    {
       ...
       DEVICE_MMIO_MAP(device, K_MEM_CACHE_NONE);
       ...
    }
 
-   int my_driver_some_function(struct device *device)
+   int my_driver_some_function(const struct device *device)
    {
       ...
       /* Write some data to the MMIO region */
@@ -532,7 +532,7 @@
       ...
    }
 
-   int my_driver_init(struct device *device)
+   int my_driver_init(const struct device *device)
    {
       ...
       DEVICE_MMIO_NAMED_MAP(device, courge, K_MEM_CACHE_NONE);
@@ -540,7 +540,7 @@
       ...
    }
 
-   int my_driver_some_function(struct device *device)
+   int my_driver_some_function(const struct device *device)
    {
       ...
       /* Write some data to the MMIO regions */
diff --git a/doc/reference/networking/8021Qav.rst b/doc/reference/networking/8021Qav.rst
index c943b6c..d5a8099 100644
--- a/doc/reference/networking/8021Qav.rst
+++ b/doc/reference/networking/8021Qav.rst
@@ -23,7 +23,7 @@
 
 .. code-block:: none
 
-	static enum ethernet_hw_caps eth_get_capabilities(struct device *dev)
+	static enum ethernet_hw_caps eth_get_capabilities(const struct device *dev)
 	{
 		ARG_UNUSED(dev);
 
diff --git a/doc/reference/networking/can_api.rst b/doc/reference/networking/can_api.rst
index 11f1aef..30bc458 100644
--- a/doc/reference/networking/can_api.rst
+++ b/doc/reference/networking/can_api.rst
@@ -178,7 +178,7 @@
           }
   }
 
-  int send_function(struct device *can_dev)
+  int send_function(const struct device *can_dev)
   {
           struct zcan_frame frame = {
                   .id_type = CAN_EXTENDED_IDENTIFIER,
diff --git a/doc/reference/power_management/index.rst b/doc/reference/power_management/index.rst
index f43c155..705a51a 100644
--- a/doc/reference/power_management/index.rst
+++ b/doc/reference/power_management/index.rst
@@ -279,7 +279,7 @@
 
 .. code-block:: c
 
-   int device_pm_control_nop(struct device *unused_device, uint32_t unused_ctrl_command, void *unused_context);
+   int device_pm_control_nop(const struct device *unused_device, uint32_t unused_ctrl_command, void *unused_context);
 
 
 If the driver doesn't implement any power control operations, the driver can
@@ -315,7 +315,7 @@
 
 .. code-block:: c
 
-   int device_set_power_state(struct device *device, uint32_t device_power_state, device_pm_cb cb, void *arg);
+   int device_set_power_state(const struct device *device, uint32_t device_power_state, device_pm_cb cb, void *arg);
 
 Calls the :c:func:`device_pm_control()` handler function implemented by the
 device driver with DEVICE_PM_SET_POWER_STATE command.
@@ -325,7 +325,7 @@
 
 .. code-block:: c
 
-   int device_get_power_state(struct device *device, uint32_t * device_power_state);
+   int device_get_power_state(const struct device *device, uint32_t * device_power_state);
 
 Calls the :c:func:`device_pm_control()` handler function implemented by the
 device driver with DEVICE_PM_GET_POWER_STATE command.
@@ -364,7 +364,7 @@
 
 .. code-block:: c
 
-   void device_busy_set(struct device *busy_dev);
+   void device_busy_set(const struct device *busy_dev);
 
 Sets a bit corresponding to the device, in a data structure maintained by the
 kernel, to indicate whether or not it is in the middle of a transaction.
@@ -374,7 +374,7 @@
 
 .. code-block:: c
 
-   void device_busy_clear(struct device *busy_dev);
+   void device_busy_clear(const struct device *busy_dev);
 
 Clears the bit corresponding to the device in a data structure
 maintained by the kernel to indicate that the device is not in the middle of
@@ -385,7 +385,7 @@
 
 .. code-block:: c
 
-   int device_busy_check(struct device *chk_dev);
+   int device_busy_check(const struct device *chk_dev);
 
 Checks whether a device is busy. The API returns 0 if the device
 is not busy.
@@ -425,7 +425,7 @@
 
 .. code-block:: c
 
-   void device_pm_enable(struct device *dev);
+   void device_pm_enable(const struct device *dev);
 
 Enbles Idle Power Management of the device.
 
@@ -434,7 +434,7 @@
 
 .. code-block:: c
 
-   void device_pm_disable(struct device *dev);
+   void device_pm_disable(const struct device *dev);
 
 Disables Idle Power Management of the device.
 
@@ -443,7 +443,7 @@
 
 .. code-block:: c
 
-   int device_pm_get(struct device *dev);
+   int device_pm_get(const struct device *dev);
 
 Marks the device as being used. This API will asynchronously
 bring the device to resume state. The API returns 0 on success.
@@ -453,7 +453,7 @@
 
 .. code-block:: c
 
-   int device_pm_get_sync(struct device *dev);
+   int device_pm_get_sync(const struct device *dev);
 
 Marks the device as being used. It will bring up or resume
 the device if it is in suspended state based on the device
@@ -465,7 +465,7 @@
 
 .. code-block:: c
 
-   int device_pm_put(struct device *dev);
+   int device_pm_put(const struct device *dev);
 
 Marks the device as being released. This API asynchronously put
 the device to suspend state if not already in suspend state.
@@ -476,7 +476,7 @@
 
 .. code-block:: c
 
-   int device_pm_put_sync(struct device *dev);
+   int device_pm_put_sync(const struct device *dev);
 
 Marks the device as being released. It will put the device to
 suspended state if is is in active state based on the device
diff --git a/doc/reference/usermode/kernelobjects.rst b/doc/reference/usermode/kernelobjects.rst
index 9b6ffd6..eba6331 100644
--- a/doc/reference/usermode/kernelobjects.rst
+++ b/doc/reference/usermode/kernelobjects.rst
@@ -8,7 +8,7 @@
 * A core kernel object, such as a semaphore, thread, pipe, etc.
 * A thread stack, which is an array of :c:struct:`z_thread_stack_element`
   and declared with :c:macro:`K_THREAD_STACK_DEFINE()`
-* A device driver instance (struct device) that belongs to one of a defined
+* A device driver instance (const struct device) that belongs to one of a defined
   set of subsystems
 
 The set of known kernel objects and driver subsystems is defined in