structresource*r; intret; priv=devm_kzalloc(&pdev->dev,sizeof(structi2c_au1550_data), GFP_KERNEL); if(!priv) return-ENOMEM; r=platform_get_resource(pdev,IORESOURCE_MEM,0); priv->psc_base=devm_ioremap_resource(&pdev->dev,r); ...
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-...
dev_err(&pdev->dev, "Failed to get memory resource\n"); return -ENXIO; } // 步骤二:调用devm_platform_ioremap_resource函数 regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(regs)) { dev_err(&pdev->dev, "Failed to ioremap resource\n"); return PTR_ERR(regs); } // ...
devm_platform_ioremap_resource 释放 开发中,如果代码不规范很容易产生内存泄漏,比如Handler、Context、线程等使用。本文使用Android Studio自带的Profiler和MAT工具进行内存泄漏分析。 一、内存泄漏 1、定义handler private Handler mHandler = new Handler(new Handler.Callback() { @Override public boolean handleMessage...
1:externvoid*devm_kzalloc(structdevice *dev, size_t size, gfp_t gfp);2:3:void__iomem *devm_ioremap_resource(structdevice *dev,4:structresource *res);5:void__iomem *devm_ioremap(structdevice *dev, resource_size_t offset,6: unsignedlongsize);7:8:structclk *devm_clk_get(structdevice ...
_alloc() devm_iio_trigger_free() devm_iio_device_register() devm_iio_device_unregister...() devm_ioport_unmap() devm_ioremap() devm_ioremap_nocache() devm_iounmap() devm_ioremap_resource...() devm_clk_put() PINCTRL devm_pinctrl_get() devm_pinctrl_put() PWM devm_pwm_get() devm_...
在下文中一共展示了devm_ioremap_resource函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。 示例1: spear_rtc_probe ▲点赞 6▼ staticintspear_rtc_probe(struct platform_device *pdev){structresource*res;structspear_...
r = platform_get_resource(pdev, IORESOURCE_MEM,0);if(r ==NULL) { ret = -ENOENT;gotoerr_put_master; } sp->base =devm_ioremap(&pdev->dev, r->start, resource_size(r));if(!sp->base) { ret = -ENXIO;gotoerr_put_master; ...
Re: [PATCH -next] scsi: hisi_sas: use devm_platform_ioremap_resource() to simplify code Martin K. Petersen Sat, 07 Sep 2019 13:42:15 -0700 YueHaibing, > Use devm_platform_ioremap_resource() to simplify the code a bit. > This is detected by coccinelle. Applied to 5.4/scsi-queue,...
+ hsotg->regs = devm_ioremap_resource(&dev->dev, &dev->resource[0]); + if (IS_ERR(hsotg->regs)) + return PTR_ERR(hsotg->regs); dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n", (unsigned long)pci_resource_start(dev, 0), hsotg->regs); ...