imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,8 +1,7 @@
 static int dma40_runtime_suspend(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct d40_base *base = platform_get_drvdata(pdev);
+  struct d40_base *base = dev_get_drvdata(dev);
   d40_save_restore_registers(base, true);
   /* Don't disable/enable clocks for v1 due to HW bugs */
   if (base->rev != 1) writel_relaxed(base->gcc_pwr_off_mask, base->virtbase + D40_DREG_GCC);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,29 +1,28 @@
 static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
+  struct rtc_plat_data *pdata = dev_get_drvdata(dev);
   void __iomem *ioaddr = pdata->ioaddr_rtc;
   unsigned int year, month, day, hour, minute, second, week;
   unsigned int century;
   /* give enough time to update RTC in case of continuous read */
   if (pdata->last_jiffies == jiffies) msleep(1);
   pdata->last_jiffies = jiffies;
   writeb(RTC_READ, ioaddr + RTC_CONTROL);
   second = readb(ioaddr + RTC_SECONDS) & RTC_SECONDS_MASK;
   minute = readb(ioaddr + RTC_MINUTES);
   hour = readb(ioaddr + RTC_HOURS);
   day = readb(ioaddr + RTC_DATE);
   week = readb(ioaddr + RTC_DAY) & RTC_DAY_MASK;
   month = readb(ioaddr + RTC_MONTH);
   year = readb(ioaddr + RTC_YEAR);
   century = readb(ioaddr + RTC_CENTURY) & RTC_CENTURY_MASK;
   writeb(0, ioaddr + RTC_CONTROL);
   tm->tm_sec = bcd2bin(second);
   tm->tm_min = bcd2bin(minute);
   tm->tm_hour = bcd2bin(hour);
   tm->tm_mday = bcd2bin(day);
   tm->tm_wday = bcd2bin(week);
   tm->tm_mon = bcd2bin(month) - 1;
   /* year is 1900 + tm->tm_year */
   tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900;
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,12 +1,11 @@
 static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev);
+  struct pcap_rtc *pcap_rtc = dev_get_drvdata(dev);
   unsigned long secs;
   u32 tod, days;
   ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TOD, &tod);
   secs = tod & PCAP_RTC_TOD_MASK;
   ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAY, &days);
   secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY;
   rtc_time_to_tm(secs, tm);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,16 +1,15 @@
 static int at_dma_suspend_noirq(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct at_dma *atdma = platform_get_drvdata(pdev);
+  struct at_dma *atdma = dev_get_drvdata(dev);
   struct dma_chan *chan, *_chan;
   /* preserve data */
   list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels, device_node) {
     struct at_dma_chan *atchan = to_at_dma_chan(chan);
     if (atc_chan_is_cyclic(atchan)) atc_suspend_cyclic(atchan);
     atchan->save_cfg = channel_readl(atchan, CFG);
   }
   atdma->save_imr = dma_readl(atdma, EBCIMR);
   /* disable DMA controller */
   at_dma_off(atdma);
   clk_disable_unprepare(atdma->clk);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,40 +1,39 @@
 static umode_t asus_sysfs_is_visible(struct kobject *kobj, struct attribute *attr, int idx) {
   struct device *dev = container_of(kobj, struct device, kobj);
-  struct platform_device *pdev = to_platform_device(dev);
-  struct asus_laptop *asus = platform_get_drvdata(pdev);
+  struct asus_laptop *asus = dev_get_drvdata(dev);
   acpi_handle handle = asus->handle;
   bool supported;
   if (asus->is_pega_lucid) {
     /* no ls_level interface on the Lucid */
     if (attr == &dev_attr_ls_switch.attr)
       supported = true;
     else if (attr == &dev_attr_ls_level.attr)
       supported = false;
     else
       goto normal;
     return supported ? attr->mode : 0;
   }
 normal:
   if (attr == &dev_attr_wlan.attr) {
     supported = !acpi_check_handle(handle, METHOD_WLAN, NULL);
   } else if (attr == &dev_attr_bluetooth.attr) {
     supported = !acpi_check_handle(handle, METHOD_BLUETOOTH, NULL);
   } else if (attr == &dev_attr_display.attr) {
     supported = !acpi_check_handle(handle, METHOD_SWITCH_DISPLAY, NULL);
   } else if (attr == &dev_attr_wimax.attr) {
     supported = !acpi_check_handle(asus->handle, METHOD_WIMAX, NULL);
   } else if (attr == &dev_attr_wwan.attr) {
     supported = !acpi_check_handle(asus->handle, METHOD_WWAN, NULL);
   } else if (attr == &dev_attr_ledd.attr) {
     supported = !acpi_check_handle(handle, METHOD_LEDD, NULL);
   } else if (attr == &dev_attr_ls_switch.attr || attr == &dev_attr_ls_level.attr) {
     supported = !acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) && !acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL);
   } else if (attr == &dev_attr_ls_value.attr) {
     supported = asus->is_pega_lucid;
   } else if (attr == &dev_attr_gps.attr) {
     supported = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) && !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) && !acpi_check_handle(handle, METHOD_GPS_STATUS, NULL);
   } else {
     supported = true;
   }
   return supported ? attr->mode : 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,8 +1,7 @@
 static int __maybe_unused cdns_runtime_suspend(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct uart_port *port = platform_get_drvdata(pdev);
+  struct uart_port *port = dev_get_drvdata(dev);
   struct cdns_uart *cdns_uart = port->private_data;
   clk_disable(cdns_uart->uartclk);
   clk_disable(cdns_uart->pclk);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,27 +1,26 @@
 static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct sh_rtc *rtc = platform_get_drvdata(pdev);
+  struct sh_rtc *rtc = dev_get_drvdata(dev);
   unsigned int rcr1;
   struct rtc_time *tm = &wkalrm->time;
   int mon;
   spin_lock_irq(&rtc->lock);
   /* disable alarm interrupt and clear the alarm flag */
   rcr1 = readb(rtc->regbase + RCR1);
   rcr1 &= ~(RCR1_AF | RCR1_AIE);
   writeb(rcr1, rtc->regbase + RCR1);
   /* set alarm time */
   sh_rtc_write_alarm_value(rtc, tm->tm_sec, RSECAR);
   sh_rtc_write_alarm_value(rtc, tm->tm_min, RMINAR);
   sh_rtc_write_alarm_value(rtc, tm->tm_hour, RHRAR);
   sh_rtc_write_alarm_value(rtc, tm->tm_wday, RWKAR);
   sh_rtc_write_alarm_value(rtc, tm->tm_mday, RDAYAR);
   mon = tm->tm_mon;
   if (mon >= 0) mon += 1;
   sh_rtc_write_alarm_value(rtc, mon, RMONAR);
   if (wkalrm->enabled) {
     rcr1 |= RCR1_AIE;
     writeb(rcr1, rtc->regbase + RCR1);
   }
   spin_unlock_irq(&rtc->lock);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,17 +1,16 @@
 static int wmt_mci_resume(struct device *dev) {
   u32 reg_tmp;
-  struct platform_device *pdev = to_platform_device(dev);
-  struct mmc_host *mmc = platform_get_drvdata(pdev);
+  struct mmc_host *mmc = dev_get_drvdata(dev);
   struct wmt_mci_priv *priv;
   if (mmc) {
     priv = mmc_priv(mmc);
     clk_enable(priv->clk_sdmmc);
     reg_tmp = readb(priv->sdmmc_base + SDMMC_BUSMODE);
     writeb(reg_tmp | BM_SOFT_RESET, priv->sdmmc_base + SDMMC_BUSMODE);
     reg_tmp = readw(priv->sdmmc_base + SDMMC_BLKLEN);
     writew(reg_tmp | (BLKL_GPI_CD | BLKL_INT_ENABLE), priv->sdmmc_base + SDMMC_BLKLEN);
     reg_tmp = readb(priv->sdmmc_base + SDMMC_INTMASK0);
     writeb(reg_tmp | INT0_DI_INT_EN, priv->sdmmc_base + SDMMC_INTMASK0);
   }
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,11 +1,10 @@
 static int mv_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
+  struct rtc_plat_data *pdata = dev_get_drvdata(dev);
   void __iomem *ioaddr = pdata->ioaddr;
   if (pdata->irq < 0) return -EINVAL; /* fall back into rtc-dev's emulation */
   if (enabled)
     writel(1, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
   else
     writel(0, ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,19 +1,18 @@
 static int atmel_xdmac_suspend(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct at_xdmac *atxdmac = platform_get_drvdata(pdev);
+  struct at_xdmac *atxdmac = dev_get_drvdata(dev);
   struct dma_chan *chan, *_chan;
   list_for_each_entry_safe(chan, _chan, &atxdmac->dma.channels, device_node) {
     struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan);
     atchan->save_cc = at_xdmac_chan_read(atchan, AT_XDMAC_CC);
     if (at_xdmac_chan_is_cyclic(atchan)) {
       if (!at_xdmac_chan_is_paused(atchan)) at_xdmac_device_pause(chan);
       atchan->save_cim = at_xdmac_chan_read(atchan, AT_XDMAC_CIM);
       atchan->save_cnda = at_xdmac_chan_read(atchan, AT_XDMAC_CNDA);
       atchan->save_cndc = at_xdmac_chan_read(atchan, AT_XDMAC_CNDC);
     }
   }
   atxdmac->save_gim = at_xdmac_read(atxdmac, AT_XDMAC_GIM);
   at_xdmac_off(atxdmac);
   clk_disable_unprepare(atxdmac->clk);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,7 +1,6 @@
 static ssize_t arm_spe_pmu_cap_show(struct device *dev, struct device_attribute *attr, char *buf) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev);
+  struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev);
   struct dev_ext_attribute *ea = container_of(attr, struct dev_ext_attribute, attr);
   int cap = (long)ea->var;
   return snprintf(buf, PAGE_SIZE, "%u\n", arm_spe_pmu_cap_get(spe_pmu, cap));
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,5 +1,4 @@
 static ssize_t arm_spe_pmu_get_attr_cpumask(struct device *dev, struct device_attribute *attr, char *buf) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev);
+  struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev);
   return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus);
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,9 +1,8 @@
 static ssize_t ds1685_rtc_sysfs_auxbatt_show(struct device *dev, struct device_attribute *attr, char *buf) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct ds1685_priv *rtc = platform_get_drvdata(pdev);
+  struct ds1685_priv *rtc = dev_get_drvdata(dev);
   u8 ctrl4a;
   ds1685_rtc_switch_to_bank1(rtc);
   ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
   ds1685_rtc_switch_to_bank0(rtc);
   return sprintf(buf, "%s\n", (ctrl4a & RTC_CTRL_4A_VRT2) ? "ok" : "not ok or N/A");
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,19 +1,18 @@
 static int vpfe_suspend(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct vpfe_device *vpfe = platform_get_drvdata(pdev);
+  struct vpfe_device *vpfe = dev_get_drvdata(dev);
   struct vpfe_ccdc *ccdc = &vpfe->ccdc;
   /* if streaming has not started we don't care */
   if (!vb2_start_streaming_called(&vpfe->buffer_queue)) return 0;
   pm_runtime_get_sync(dev);
   vpfe_config_enable(ccdc, 1);
   /* Save VPFE context */
   vpfe_save_context(ccdc);
   /* Disable CCDC */
   vpfe_pcr_enable(ccdc, 0);
   vpfe_config_enable(ccdc, 0);
   /* Disable both master and slave clock */
   pm_runtime_put_sync(dev);
   /* Select sleep pin state */
   pinctrl_pm_select_sleep_state(dev);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,5 +1,4 @@
 static int __maybe_unused qcom_iommu_resume(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
+  struct qcom_iommu_dev *qcom_iommu = dev_get_drvdata(dev);
   return qcom_iommu_enable_clocks(qcom_iommu);
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,7 +1,6 @@
 static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct spi_master *master = platform_get_drvdata(pdev);
+  struct spi_master *master = dev_get_drvdata(dev);
   spi_master_suspend(master);
   zynqmp_unprepare_transfer_hardware(master);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,17 +1,16 @@
 static int vpfe_resume(struct device *dev) {
-  struct platform_device *pdev = to_platform_device(dev);
-  struct vpfe_device *vpfe = platform_get_drvdata(pdev);
+  struct vpfe_device *vpfe = dev_get_drvdata(dev);
   struct vpfe_ccdc *ccdc = &vpfe->ccdc;
   /* if streaming has not started we don't care */
   if (!vb2_start_streaming_called(&vpfe->buffer_queue)) return 0;
   /* Enable both master and slave clock */
   pm_runtime_get_sync(dev);
   vpfe_config_enable(ccdc, 1);
   /* Restore VPFE context */
   vpfe_restore_context(ccdc);
   vpfe_config_enable(ccdc, 0);
   pm_runtime_put_sync(dev);
   /* Select default pin state */
   pinctrl_pm_select_default_state(dev);
   return 0;
 }<sep>@@
identifier e1;
expression e2;
type T;
@@

(
- T e1 = to_platform_device(e2);
  ...
- platform_get_drvdata(e1)
+ dev_get_drvdata(e2)
  ... when any
&
  T e1 = to_platform_device(e2);
  <... when != e1
(
  platform_get_drvdata(e1)
|
- &e1->dev
+ e2
)
  ...>
)
--- initial
+++ final
@@ -1,26 +1,26 @@
 static int dwc2_phy_init(struct dwc2_hsotg *hsotg, bool select_phy) {
   u32 usbcfg;
   int retval = 0;
   if ((hsotg->params.speed == DWC2_SPEED_PARAM_FULL || hsotg->params.speed == DWC2_SPEED_PARAM_LOW) && hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS) {
     /* If FS/LS mode with FS/LS PHY */
     retval = dwc2_fs_phy_init(hsotg, select_phy);
     if (retval) return retval;
   } else {
     /* High speed PHY */
     retval = dwc2_hs_phy_init(hsotg, select_phy);
     if (retval) return retval;
   }
   if (hsotg->hw_params.hs_phy_type == GHWCFG2_HS_PHY_TYPE_ULPI && hsotg->hw_params.fs_phy_type == GHWCFG2_FS_PHY_TYPE_DEDICATED && hsotg->params.ulpi_fs_ls) {
     dev_dbg(hsotg->dev, "Setting ULPI FSLS\n");
-    usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
+    usbcfg = dwc2_readl(hsotg, GUSBCFG);
     usbcfg |= GUSBCFG_ULPI_FS_LS;
     usbcfg |= GUSBCFG_ULPI_CLK_SUSP_M;
-    dwc2_writel(usbcfg, hsotg->regs + GUSBCFG);
+    dwc2_writel(hsotg, usbcfg, GUSBCFG);
   } else {
-    usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
+    usbcfg = dwc2_readl(hsotg, GUSBCFG);
     usbcfg &= ~GUSBCFG_ULPI_FS_LS;
     usbcfg &= ~GUSBCFG_ULPI_CLK_SUSP_M;
-    dwc2_writel(usbcfg, hsotg->regs + GUSBCFG);
+    dwc2_writel(hsotg, usbcfg, GUSBCFG);
   }
   return retval;
 }<sep>@@
expression hsotg,e;
@@

- dwc2_readl(hsotg->regs + e)
+ dwc2_readl(hsotg, e)

@@
expression hsotg,e,v;
@@
- dwc2_writel(v, hsotg->regs + e)
+ dwc2_writel(hsotg, v, e)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static u32 dwc2_gadget_read_ep_interrupts(struct dwc2_hsotg *hsotg, unsigned int idx, int dir_in) {
   u32 epmsk_reg = dir_in ? DIEPMSK : DOEPMSK;
   u32 epint_reg = dir_in ? DIEPINT(idx) : DOEPINT(idx);
   u32 ints;
   u32 mask;
   u32 diepempmsk;
-  mask = dwc2_readl(hsotg->regs + epmsk_reg);
-  diepempmsk = dwc2_readl(hsotg->regs + DIEPEMPMSK);
+  mask = dwc2_readl(hsotg, epmsk_reg);
+  diepempmsk = dwc2_readl(hsotg, DIEPEMPMSK);
   mask |= ((diepempmsk >> idx) & 0x1) ? DIEPMSK_TXFIFOEMPTY : 0;
   mask |= DXEPINT_SETUP_RCVD;
-  ints = dwc2_readl(hsotg->regs + epint_reg);
+  ints = dwc2_readl(hsotg, epint_reg);
   ints &= mask;
   return ints;
 }<sep>@@
expression hsotg,e;
@@

- dwc2_readl(hsotg->regs + e)
+ dwc2_readl(hsotg, e)
--- initial
+++ final
@@ -1,9 +1,9 @@
 static void dwc2_complete_periodic_xfer(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan, int chnum, struct dwc2_qtd *qtd, enum dwc2_halt_status halt_status) {
-  u32 hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum));
+  u32 hctsiz = dwc2_readl(hsotg, HCTSIZ(chnum));
   qtd->error_count = 0;
   if (!chan->ep_is_in || (hctsiz & TSIZ_PKTCNT_MASK) == 0) /* Core halts channel in these cases */
     dwc2_release_channel(hsotg, chan, qtd, halt_status);
   else
     /* Flush any outstanding requests from the Tx queue */
     dwc2_halt_channel(hsotg, chan, qtd, halt_status);
 }<sep>@@
expression hsotg,e;
@@

- dwc2_readl(hsotg->regs + e)
+ dwc2_readl(hsotg, e)
--- initial
+++ final
@@ -1,54 +1,54 @@
 static void dwc2_hc_ahberr_intr(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan, int chnum, struct dwc2_qtd *qtd) {
   struct dwc2_hcd_urb *urb = qtd->urb;
   char *pipetype, *speed;
   u32 hcchar;
   u32 hcsplt;
   u32 hctsiz;
   u32 hc_dma;
   dev_dbg(hsotg->dev, "--Host Channel %d Interrupt: AHB Error--\n", chnum);
   if (!urb) goto handle_ahberr_halt;
   dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
-  hcchar = dwc2_readl(hsotg->regs + HCCHAR(chnum));
-  hcsplt = dwc2_readl(hsotg->regs + HCSPLT(chnum));
-  hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum));
-  hc_dma = dwc2_readl(hsotg->regs + HCDMA(chnum));
+  hcchar = dwc2_readl(hsotg, HCCHAR(chnum));
+  hcsplt = dwc2_readl(hsotg, HCSPLT(chnum));
+  hctsiz = dwc2_readl(hsotg, HCTSIZ(chnum));
+  hc_dma = dwc2_readl(hsotg, HCDMA(chnum));
   dev_err(hsotg->dev, "AHB ERROR, Channel %d\n", chnum);
   dev_err(hsotg->dev, "  hcchar 0x%08x, hcsplt 0x%08x\n", hcchar, hcsplt);
   dev_err(hsotg->dev, "  hctsiz 0x%08x, hc_dma 0x%08x\n", hctsiz, hc_dma);
   dev_err(hsotg->dev, "  Device address: %d\n", dwc2_hcd_get_dev_addr(&urb->pipe_info));
   dev_err(hsotg->dev, "  Endpoint: %d, %s\n", dwc2_hcd_get_ep_num(&urb->pipe_info), dwc2_hcd_is_pipe_in(&urb->pipe_info) ? "IN" : "OUT");
   switch (dwc2_hcd_get_pipe_type(&urb->pipe_info)) {
   case USB_ENDPOINT_XFER_CONTROL: pipetype = "CONTROL"; break;
   case USB_ENDPOINT_XFER_BULK: pipetype = "BULK"; break;
   case USB_ENDPOINT_XFER_INT: pipetype = "INTERRUPT"; break;
   case USB_ENDPOINT_XFER_ISOC: pipetype = "ISOCHRONOUS"; break;
   default: pipetype = "UNKNOWN"; break;
   }
   dev_err(hsotg->dev, "  Endpoint type: %s\n", pipetype);
   switch (chan->speed) {
   case USB_SPEED_HIGH: speed = "HIGH"; break;
   case USB_SPEED_FULL: speed = "FULL"; break;
   case USB_SPEED_LOW: speed = "LOW"; break;
   default: speed = "UNKNOWN"; break;
   }
   dev_err(hsotg->dev, "  Speed: %s\n", speed);
   dev_err(hsotg->dev, "  Max packet size: %d\n", dwc2_hcd_get_mps(&urb->pipe_info));
   dev_err(hsotg->dev, "  Data buffer length: %d\n", urb->length);
   dev_err(hsotg->dev, "  Transfer buffer: %p, Transfer DMA: %08lx\n", urb->buf, (unsigned long)urb->dma);
   dev_err(hsotg->dev, "  Setup buffer: %p, Setup DMA: %08lx\n", urb->setup_packet, (unsigned long)urb->setup_dma);
   dev_err(hsotg->dev, "  Interval: %d\n", urb->interval);
   /* Core halts the channel for Descriptor DMA mode */
   if (hsotg->params.dma_desc_enable) {
     dwc2_hcd_complete_xfer_ddma(hsotg, chan, chnum, DWC2_HC_XFER_AHB_ERR);
     goto handle_ahberr_done;
   }
   dwc2_host_complete(hsotg, qtd, -EIO);
 handle_ahberr_halt:
   /*
    * Force a channel halt. Don't call dwc2_halt_channel because that won't
    * write to the HCCHARn register in DMA mode to force the halt.
    */
   dwc2_hc_halt(hsotg, chan, DWC2_HC_XFER_AHB_ERR);
 handle_ahberr_done:
   disable_hc_int(hsotg, chnum, HCINTMSK_AHBERR);
 }<sep>@@
expression hsotg,e;
@@

- dwc2_readl(hsotg->regs + e)
+ dwc2_readl(hsotg, e)