Skip to content

Commit

Permalink
net: ipa: pass a platform device to ipa_reg_init()
Browse files Browse the repository at this point in the history
Rather than using the platform device pointer field in the IPA
pointer, pass a platform device pointer to ipa_reg_init().  Use
that pointer throughout that function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alex Elder authored and David S. Miller committed Mar 4, 2024
1 parent ad1be80 commit a47956e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ipa/ipa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ static int ipa_probe(struct platform_device *pdev)
ipa->modem_route_count = data->modem_route_count;
init_completion(&ipa->completion);

ret = ipa_reg_init(ipa);
ret = ipa_reg_init(ipa, pdev);
if (ret)
goto err_kfree_ipa;

Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ipa/ipa_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2019-2023 Linaro Ltd.
*/

#include <linux/platform_device.h>
#include <linux/io.h>

#include "ipa.h"
Expand Down Expand Up @@ -132,9 +133,9 @@ static const struct regs *ipa_regs(enum ipa_version version)
}
}

int ipa_reg_init(struct ipa *ipa)
int ipa_reg_init(struct ipa *ipa, struct platform_device *pdev)
{
struct device *dev = &ipa->pdev->dev;
struct device *dev = &pdev->dev;
const struct regs *regs;
struct resource *res;

Expand All @@ -146,8 +147,7 @@ int ipa_reg_init(struct ipa *ipa)
return -EINVAL;

/* Setup IPA register memory */
res = platform_get_resource_byname(ipa->pdev, IORESOURCE_MEM,
"ipa-reg");
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ipa-reg");
if (!res) {
dev_err(dev, "DT error getting \"ipa-reg\" memory property\n");
return -ENODEV;
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ipa/ipa_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "ipa_version.h"
#include "reg.h"

struct platform_device;

struct ipa;

/**
Expand Down Expand Up @@ -643,7 +645,7 @@ extern const struct regs ipa_regs_v5_5;

const struct reg *ipa_reg(struct ipa *ipa, enum ipa_reg_id reg_id);

int ipa_reg_init(struct ipa *ipa);
int ipa_reg_init(struct ipa *ipa, struct platform_device *pdev);
void ipa_reg_exit(struct ipa *ipa);

#endif /* _IPA_REG_H_ */

0 comments on commit a47956e

Please sign in to comment.