intel_th: Constify all drvdata references
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Wed, 14 Apr 2021 17:12:47 +0000 (20:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Apr 2021 05:26:50 +0000 (07:26 +0200)
Anything that deals with drvdata structures should leave them intact.
Reflect this in function signatures.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414171251.14672-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/core.c
drivers/hwtracing/intel_th/intel_th.h
drivers/hwtracing/intel_th/pci.c

index c9ac3dc651135d156915f425ce9c232c94e568ad..24d0c974bfd55d400c8b7362152fde49f33a427b 100644 (file)
@@ -844,7 +844,7 @@ static irqreturn_t intel_th_irq(int irq, void *data)
  * @irq:       irq number
  */
 struct intel_th *
-intel_th_alloc(struct device *dev, struct intel_th_drvdata *drvdata,
+intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata,
               struct resource *devres, unsigned int ndevres)
 {
        int err, r, nr_mmios = 0;
index 5fe694708b7a3117991900ea89028b366ae18810..05fa2dab37d1ee5897e1e661d50495a58f7926cd 100644 (file)
@@ -74,7 +74,7 @@ struct intel_th_drvdata {
  */
 struct intel_th_device {
        struct device           dev;
-       struct intel_th_drvdata *drvdata;
+       const struct intel_th_drvdata *drvdata;
        struct resource         *resource;
        unsigned int            num_resources;
        unsigned int            type;
@@ -224,7 +224,7 @@ static inline struct intel_th *to_intel_th(struct intel_th_device *thdev)
 }
 
 struct intel_th *
-intel_th_alloc(struct device *dev, struct intel_th_drvdata *drvdata,
+intel_th_alloc(struct device *dev, const struct intel_th_drvdata *drvdata,
               struct resource *devres, unsigned int ndevres);
 void intel_th_free(struct intel_th *th);
 
@@ -272,7 +272,7 @@ struct intel_th {
 
        struct intel_th_device  *thdev[TH_SUBDEVICE_MAX];
        struct intel_th_device  *hub;
-       struct intel_th_drvdata *drvdata;
+       const struct intel_th_drvdata   *drvdata;
 
        struct resource         resource[TH_MMIO_END];
        int                     (*activate)(struct intel_th *);
index 251e75c9ba9d0dda26e17d2558715a00a7a923bb..759994055cb4d0d9b4b35afac8fc84255b56e09e 100644 (file)
@@ -71,7 +71,7 @@ static void intel_th_pci_deactivate(struct intel_th *th)
 static int intel_th_pci_probe(struct pci_dev *pdev,
                              const struct pci_device_id *id)
 {
-       struct intel_th_drvdata *drvdata = (void *)id->driver_data;
+       const struct intel_th_drvdata *drvdata = (void *)id->driver_data;
        struct resource resource[TH_MMIO_END + TH_NVEC_MAX] = {
                [TH_MMIO_CONFIG]        = pdev->resource[TH_PCI_CONFIG_BAR],
                [TH_MMIO_SW]            = pdev->resource[TH_PCI_STH_SW_BAR],