From: kernel test robot <lkp@intel.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [robh:for-kernelci 21/21] drivers/spi/spi-stm32-ospi.c:828:67: error: passing argument 3 of 'of_reserved_mem_region_to_resource' from incompatible pointer type
Date: Tue, 6 May 2025 20:59:08 +0800 [thread overview]
Message-ID: <202505062023.qlrf8VZc-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-kernelci
head: 3474fc53f28d0824c7020ddffc8559e8302f7415
commit: 3474fc53f28d0824c7020ddffc8559e8302f7415 [21/21] spi: Use of_reserved_mem_region_to_resource() for "memory-region"
config: i386-buildonly-randconfig-2004-20250506 (https://download.01.org/0day-ci/archive/20250506/202505062023.qlrf8VZc-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250506/202505062023.qlrf8VZc-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505062023.qlrf8VZc-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/spi/spi-stm32-ospi.c: In function 'stm32_ospi_get_resources':
>> drivers/spi/spi-stm32-ospi.c:828:67: error: passing argument 3 of 'of_reserved_mem_region_to_resource' from incompatible pointer type [-Werror=incompatible-pointer-types]
828 | ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
| ^~~~
| |
| struct resource **
In file included from drivers/spi/spi-stm32-ospi.c:23:
include/linux/of_reserved_mem.h:44:75: note: expected 'struct resource *' but argument is of type 'struct resource **'
44 | unsigned int idx, struct resource *res);
| ~~~~~~~~~~~~~~~~~^~~
>> drivers/spi/spi-stm32-ospi.c:830:47: error: passing argument 1 of 'resource_size' from incompatible pointer type [-Werror=incompatible-pointer-types]
830 | ospi->mm_size = resource_size(&res);
| ^~~~
| |
| struct resource **
In file included from include/linux/device.h:17,
from include/linux/dma-mapping.h:5,
from drivers/spi/spi-stm32-ospi.c:9:
include/linux/ioport.h:289:68: note: expected 'const struct resource *' but argument is of type 'struct resource **'
289 | static inline resource_size_t resource_size(const struct resource *res)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
>> drivers/spi/spi-stm32-ospi.c:831:60: error: passing argument 2 of 'devm_ioremap_resource' from incompatible pointer type [-Werror=incompatible-pointer-types]
831 | ospi->mm_base = devm_ioremap_resource(dev, &res);
| ^~~~
| |
| struct resource **
In file included from include/linux/device.h:31:
include/linux/device/devres.h:101:80: note: expected 'const struct resource *' but argument is of type 'struct resource **'
101 | void __iomem *devm_ioremap_resource(struct device *dev, const struct resource *res);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
>> drivers/spi/spi-stm32-ospi.c:776:29: warning: unused variable 'node' [-Wunused-variable]
776 | struct device_node *node;
| ^~~~
>> drivers/spi/spi-stm32-ospi.c:775:30: warning: unused variable 'rmem' [-Wunused-variable]
775 | struct reserved_mem *rmem = NULL;
| ^~~~
cc1: some warnings being treated as errors
vim +/of_reserved_mem_region_to_resource +828 drivers/spi/spi-stm32-ospi.c
769
770 static int stm32_ospi_get_resources(struct platform_device *pdev)
771 {
772 struct device *dev = &pdev->dev;
773 struct stm32_ospi *ospi = platform_get_drvdata(pdev);
774 struct resource *res;
> 775 struct reserved_mem *rmem = NULL;
> 776 struct device_node *node;
777 int ret;
778
779 ospi->regs_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
780 if (IS_ERR(ospi->regs_base))
781 return PTR_ERR(ospi->regs_base);
782
783 ospi->regs_phys_base = res->start;
784
785 ospi->clk = devm_clk_get(dev, NULL);
786 if (IS_ERR(ospi->clk))
787 return dev_err_probe(dev, PTR_ERR(ospi->clk),
788 "Can't get clock\n");
789
790 ospi->clk_rate = clk_get_rate(ospi->clk);
791 if (!ospi->clk_rate) {
792 dev_err(dev, "Invalid clock rate\n");
793 return -EINVAL;
794 }
795
796 ospi->irq = platform_get_irq(pdev, 0);
797 if (ospi->irq < 0)
798 return ospi->irq;
799
800 ret = devm_request_irq(dev, ospi->irq, stm32_ospi_irq, 0,
801 dev_name(dev), ospi);
802 if (ret) {
803 dev_err(dev, "Failed to request irq\n");
804 return ret;
805 }
806
807 ospi->rstc = devm_reset_control_array_get_optional_exclusive(dev);
808 if (IS_ERR(ospi->rstc))
809 return dev_err_probe(dev, PTR_ERR(ospi->rstc),
810 "Can't get reset\n");
811
812 ospi->dma_chrx = dma_request_chan(dev, "rx");
813 if (IS_ERR(ospi->dma_chrx)) {
814 ret = PTR_ERR(ospi->dma_chrx);
815 ospi->dma_chrx = NULL;
816 if (ret == -EPROBE_DEFER)
817 goto err_dma;
818 }
819
820 ospi->dma_chtx = dma_request_chan(dev, "tx");
821 if (IS_ERR(ospi->dma_chtx)) {
822 ret = PTR_ERR(ospi->dma_chtx);
823 ospi->dma_chtx = NULL;
824 if (ret == -EPROBE_DEFER)
825 goto err_dma;
826 }
827
> 828 ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
829 if (!ret) {
> 830 ospi->mm_size = resource_size(&res);
> 831 ospi->mm_base = devm_ioremap_resource(dev, &res);
832 if (!ospi->mm_base) {
833 dev_err(dev, "unable to map memory region: %pR\n", &res);
834 ret = -ENOMEM;
835 goto err_dma;
836 }
837
838 if (ospi->mm_size > STM32_OSPI_MAX_MMAP_SZ) {
839 dev_err(dev, "Memory map size outsize bounds\n");
840 ret = -EINVAL;
841 goto err_dma;
842 }
843 } else {
844 dev_info(dev, "No memory-map region found\n");
845 }
846
847 init_completion(&ospi->data_completion);
848 init_completion(&ospi->match_completion);
849
850 return 0;
851
852 err_dma:
853 dev_info(dev, "Can't get all resources (%d)\n", ret);
854
855 if (ospi->dma_chtx)
856 dma_release_channel(ospi->dma_chtx);
857 if (ospi->dma_chrx)
858 dma_release_channel(ospi->dma_chrx);
859
860 return ret;
861 };
862
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-05-06 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 12:59 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-04-30 16:45 [robh:for-kernelci 21/21] drivers/spi/spi-stm32-ospi.c:828:67: error: passing argument 3 of 'of_reserved_mem_region_to_resource' from incompatible pointer type kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505062023.qlrf8VZc-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.