ASoC: Intel: catpt: Replace RAM-helpers with resource_xxx()

For catpt_sram_init(), the exact same functionality has been provided to
ioport.h with commit 9fb6fef0fb ("resource: Add resource set range and
size helpers") in recent years.

As for catpt_dram/iram_size(), leave it for the driver initialization
only.  Have all other manipulations be done using resource_xxx() API
which are more familiar to kernel developers.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260603085827.1964796-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Cezary Rojewski
2026-06-03 10:58:22 +02:00
committed by Mark Brown
parent 36685d0b05
commit a88cd88eee
3 changed files with 4 additions and 13 deletions

View File

@@ -17,7 +17,6 @@ struct catpt_dev;
extern const struct attribute_group *catpt_attr_groups[];
void catpt_sram_init(struct resource *sram, u32 start, u32 size);
void catpt_sram_free(struct resource *sram);
struct resource *
catpt_request_region(struct resource *root, resource_size_t size);

View File

@@ -233,12 +233,9 @@ static void catpt_dev_init(struct catpt_dev *cdev, struct device *dev,
cdev->devfmt[CATPT_SSP_IFACE_0].iface = UINT_MAX;
cdev->devfmt[CATPT_SSP_IFACE_1].iface = UINT_MAX;
resource_set_range(&cdev->dram, spec->host_dram_offset, catpt_dram_size(cdev));
resource_set_range(&cdev->iram, spec->host_iram_offset, catpt_iram_size(cdev));
catpt_ipc_init(&cdev->ipc, dev);
catpt_sram_init(&cdev->dram, spec->host_dram_offset,
catpt_dram_size(cdev));
catpt_sram_init(&cdev->iram, spec->host_iram_offset,
catpt_iram_size(cdev));
}
static int catpt_acpi_probe(struct platform_device *pdev)
@@ -287,7 +284,7 @@ static int catpt_acpi_probe(struct platform_device *pdev)
if (ret)
return ret;
cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, catpt_dram_size(cdev),
cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, resource_size(&cdev->dram),
&cdev->dxbuf_paddr, GFP_KERNEL);
if (!cdev->dxbuf_vaddr)
return -ENOMEM;

View File

@@ -7,6 +7,7 @@
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include "core.h"
#include "registers.h"
@@ -50,12 +51,6 @@ struct catpt_fw_block_hdr {
u32 rsvd;
} __packed;
void catpt_sram_init(struct resource *sram, u32 start, u32 size)
{
sram->start = start;
sram->end = start + size - 1;
}
void catpt_sram_free(struct resource *sram)
{
struct resource *res, *save;