Skip to content

Commit

Permalink
media: rkisp1: Rename rkisp1_match_data to rkisp1_info
Browse files Browse the repository at this point in the history
The rkisp1_match_data structure contains device model-specific
information. It it referenced from OF match data, but that's an
implementation detail. Rename it to rkisp1_info to reflect its main
purpose.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Paul Elder <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pinchartl authored and mchehab committed Jul 17, 2022
1 parent 196179c commit cdce5b9
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct rkisp1_isr_data {
irqreturn_t (*isr)(int irq, void *ctx);
};

struct rkisp1_match_data {
struct rkisp1_info {
const char * const *clks;
unsigned int clk_size;
const struct rkisp1_isr_data *isrs;
Expand Down Expand Up @@ -420,7 +420,7 @@ static const struct rkisp1_isr_data px30_isp_isrs[] = {
{ "mipi", rkisp1_mipi_isr },
};

static const struct rkisp1_match_data px30_isp_match_data = {
static const struct rkisp1_info px30_isp_info = {
.clks = px30_isp_clks,
.clk_size = ARRAY_SIZE(px30_isp_clks),
.isrs = px30_isp_isrs,
Expand All @@ -438,7 +438,7 @@ static const struct rkisp1_isr_data rk3399_isp_isrs[] = {
{ NULL, rkisp1_isr },
};

static const struct rkisp1_match_data rk3399_isp_match_data = {
static const struct rkisp1_info rk3399_isp_info = {
.clks = rk3399_isp_clks,
.clk_size = ARRAY_SIZE(rk3399_isp_clks),
.isrs = rk3399_isp_isrs,
Expand All @@ -449,28 +449,28 @@ static const struct rkisp1_match_data rk3399_isp_match_data = {
static const struct of_device_id rkisp1_of_match[] = {
{
.compatible = "rockchip,px30-cif-isp",
.data = &px30_isp_match_data,
.data = &px30_isp_info,
},
{
.compatible = "rockchip,rk3399-cif-isp",
.data = &rk3399_isp_match_data,
.data = &rk3399_isp_info,
},
{},
};
MODULE_DEVICE_TABLE(of, rkisp1_of_match);

static int rkisp1_probe(struct platform_device *pdev)
{
const struct rkisp1_match_data *match_data;
const struct rkisp1_info *info;
struct device *dev = &pdev->dev;
struct rkisp1_device *rkisp1;
struct v4l2_device *v4l2_dev;
unsigned int i;
int ret, irq;
u32 cif_id;

match_data = of_device_get_match_data(&pdev->dev);
if (!match_data)
info = of_device_get_match_data(&pdev->dev);
if (!info)
return -ENODEV;

rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
Expand All @@ -486,27 +486,27 @@ static int rkisp1_probe(struct platform_device *pdev)
if (IS_ERR(rkisp1->base_addr))
return PTR_ERR(rkisp1->base_addr);

for (i = 0; i < match_data->isr_size; i++) {
irq = match_data->isrs[i].name
? platform_get_irq_byname(pdev, match_data->isrs[i].name)
for (i = 0; i < info->isr_size; i++) {
irq = info->isrs[i].name
? platform_get_irq_byname(pdev, info->isrs[i].name)
: platform_get_irq(pdev, i);
if (irq < 0)
return irq;

ret = devm_request_irq(dev, irq, match_data->isrs[i].isr, IRQF_SHARED,
ret = devm_request_irq(dev, irq, info->isrs[i].isr, IRQF_SHARED,
dev_driver_string(dev), dev);
if (ret) {
dev_err(dev, "request irq failed: %d\n", ret);
return ret;
}
}

for (i = 0; i < match_data->clk_size; i++)
rkisp1->clks[i].id = match_data->clks[i];
ret = devm_clk_bulk_get(dev, match_data->clk_size, rkisp1->clks);
for (i = 0; i < info->clk_size; i++)
rkisp1->clks[i].id = info->clks[i];
ret = devm_clk_bulk_get(dev, info->clk_size, rkisp1->clks);
if (ret)
return ret;
rkisp1->clk_size = match_data->clk_size;
rkisp1->clk_size = info->clk_size;

pm_runtime_enable(&pdev->dev);

Expand All @@ -519,7 +519,7 @@ static int rkisp1_probe(struct platform_device *pdev)

pm_runtime_put(&pdev->dev);

rkisp1->media_dev.hw_revision = match_data->isp_ver;
rkisp1->media_dev.hw_revision = info->isp_ver;
strscpy(rkisp1->media_dev.model, RKISP1_DRIVER_NAME,
sizeof(rkisp1->media_dev.model));
rkisp1->media_dev.dev = &pdev->dev;
Expand Down

0 comments on commit cdce5b9

Please sign in to comment.