Commit 5245f4fd authored by Alex Elder's avatar Alex Elder Committed by David S. Miller
Browse files

net: ipa: don't save the platform device



The IPA platform device is now only used as the structure containing
the IPA device structure.  Replace the platform device pointer with
a pointer to the device structure.

Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 81d65f34
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
struct clk;
struct icc_path;
struct net_device;
struct platform_device;

struct ipa_power;
struct ipa_smp2p;
@@ -31,7 +30,7 @@ struct ipa_interrupt;
 * struct ipa - IPA information
 * @gsi:		Embedded GSI structure
 * @version:		IPA hardware version
 * @pdev:		Platform device
 * @dev:		IPA device pointer
 * @completion:		Used to signal pipeline clear transfer complete
 * @nb:			Notifier block used for remoteproc SSR
 * @notifier:		Remoteproc SSR notifier
@@ -79,7 +78,7 @@ struct ipa_interrupt;
struct ipa {
	struct gsi gsi;
	enum ipa_version version;
	struct platform_device *pdev;
	struct device *dev;
	struct completion completion;
	struct notifier_block nb;
	void *notifier;
+3 −3
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ bool ipa_cmd_table_init_valid(struct ipa *ipa, const struct ipa_mem *mem,
	u32 offset_max = field_max(IP_FLTRT_FLAGS_NHASH_ADDR_FMASK);
	u32 size_max = field_max(IP_FLTRT_FLAGS_NHASH_SIZE_FMASK);
	const char *table = route ? "route" : "filter";
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	u32 size;

	size = route ? ipa->route_count : ipa->filter_count + 1;
@@ -204,7 +204,7 @@ bool ipa_cmd_table_init_valid(struct ipa *ipa, const struct ipa_mem *mem,
/* Validate the memory region that holds headers */
static bool ipa_cmd_header_init_local_valid(struct ipa *ipa)
{
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	const struct ipa_mem *mem;
	u32 offset_max;
	u32 size_max;
@@ -256,7 +256,7 @@ static bool ipa_cmd_register_write_offset_valid(struct ipa *ipa,
						const char *name, u32 offset)
{
	struct ipa_cmd_register_write *payload;
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	u32 offset_max;
	u32 bit_count;

+14 −15
Original line number Diff line number Diff line
@@ -233,8 +233,8 @@ static bool ipa_endpoint_data_valid_one(struct ipa *ipa, u32 count,
			    const struct ipa_gsi_endpoint_data *data)
{
	const struct ipa_gsi_endpoint_data *other_data;
	struct device *dev = &ipa->pdev->dev;
	enum ipa_endpoint_name other_name;
	struct device *dev = ipa->dev;

	if (ipa_gsi_endpoint_data_empty(data))
		return true;
@@ -388,7 +388,7 @@ static u32 ipa_endpoint_max(struct ipa *ipa, u32 count,
			    const struct ipa_gsi_endpoint_data *data)
{
	const struct ipa_gsi_endpoint_data *dp = data;
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	enum ipa_endpoint_name name;
	u32 max;

@@ -606,7 +606,7 @@ int ipa_endpoint_modem_exception_reset_all(struct ipa *ipa)
	count = ipa->modem_tx_count + ipa_cmd_pipeline_clear_count();
	trans = ipa_cmd_trans_alloc(ipa, count);
	if (!trans) {
		dev_err(&ipa->pdev->dev,
		dev_err(ipa->dev,
			"no transaction to reset modem exception endpoints\n");
		return -EBUSY;
	}
@@ -1498,8 +1498,7 @@ ipa_endpoint_status_tag_valid(struct ipa_endpoint *endpoint, const void *data)
	if (endpoint_id == command_endpoint->endpoint_id) {
		complete(&ipa->completion);
	} else {
		dev_err(&ipa->pdev->dev,
			"unexpected tagged packet from endpoint %u\n",
		dev_err(ipa->dev, "unexpected tagged packet from endpoint %u\n",
			endpoint_id);
	}

@@ -1536,6 +1535,7 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint,
	void *data = page_address(page) + NET_SKB_PAD;
	u32 unused = buffer_size - total_len;
	struct ipa *ipa = endpoint->ipa;
	struct device *dev = ipa->dev;
	u32 resid = total_len;

	while (resid) {
@@ -1544,7 +1544,7 @@ static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint,
		u32 len;

		if (resid < IPA_STATUS_SIZE) {
			dev_err(&endpoint->ipa->pdev->dev,
			dev_err(dev,
				"short message (%u bytes < %zu byte status)\n",
				resid, IPA_STATUS_SIZE);
			break;
@@ -1666,8 +1666,8 @@ void ipa_endpoint_default_route_clear(struct ipa *ipa)
 */
static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint)
{
	struct device *dev = &endpoint->ipa->pdev->dev;
	struct ipa *ipa = endpoint->ipa;
	struct device *dev = ipa->dev;
	struct gsi *gsi = &ipa->gsi;
	bool suspended = false;
	dma_addr_t addr;
@@ -1769,7 +1769,7 @@ static void ipa_endpoint_reset(struct ipa_endpoint *endpoint)
		gsi_channel_reset(&ipa->gsi, channel_id, true);

	if (ret)
		dev_err(&ipa->pdev->dev,
		dev_err(ipa->dev,
			"error %d resetting channel %u for endpoint %u\n",
			ret, endpoint->channel_id, endpoint->endpoint_id);
}
@@ -1817,7 +1817,7 @@ int ipa_endpoint_enable_one(struct ipa_endpoint *endpoint)

	ret = gsi_channel_start(gsi, endpoint->channel_id);
	if (ret) {
		dev_err(&ipa->pdev->dev,
		dev_err(ipa->dev,
			"error %d starting %cX channel %u for endpoint %u\n",
			ret, endpoint->toward_ipa ? 'T' : 'R',
			endpoint->channel_id, endpoint_id);
@@ -1854,14 +1854,13 @@ void ipa_endpoint_disable_one(struct ipa_endpoint *endpoint)
	/* Note that if stop fails, the channel's state is not well-defined */
	ret = gsi_channel_stop(gsi, endpoint->channel_id);
	if (ret)
		dev_err(&ipa->pdev->dev,
			"error %d attempting to stop endpoint %u\n", ret,
			endpoint_id);
		dev_err(ipa->dev, "error %d attempting to stop endpoint %u\n",
			ret, endpoint_id);
}

void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint)
{
	struct device *dev = &endpoint->ipa->pdev->dev;
	struct device *dev = endpoint->ipa->dev;
	struct gsi *gsi = &endpoint->ipa->gsi;
	int ret;

@@ -1881,7 +1880,7 @@ void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint)

void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint)
{
	struct device *dev = &endpoint->ipa->pdev->dev;
	struct device *dev = endpoint->ipa->dev;
	struct gsi *gsi = &endpoint->ipa->gsi;
	int ret;

@@ -1983,7 +1982,7 @@ void ipa_endpoint_deconfig(struct ipa *ipa)

int ipa_endpoint_config(struct ipa *ipa)
{
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	const struct reg *reg;
	u32 endpoint_id;
	u32 hw_limit;
+3 −4
Original line number Diff line number Diff line
@@ -110,14 +110,13 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id)
	struct ipa_interrupt *interrupt = dev_id;
	struct ipa *ipa = interrupt->ipa;
	u32 enabled = interrupt->enabled;
	struct device *dev = ipa->dev;
	const struct reg *reg;
	struct device *dev;
	u32 pending;
	u32 offset;
	u32 mask;
	int ret;

	dev = &ipa->pdev->dev;
	ret = pm_runtime_get_sync(dev);
	if (WARN_ON(ret < 0))
		goto out_power_put;
@@ -240,8 +239,8 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt)
int ipa_interrupt_config(struct ipa *ipa)
{
	struct ipa_interrupt *interrupt = ipa->interrupt;
	struct device *dev = &ipa->pdev->dev;
	unsigned int irq = interrupt->irq;
	struct device *dev = ipa->dev;
	const struct reg *reg;
	int ret;

@@ -281,7 +280,7 @@ int ipa_interrupt_config(struct ipa *ipa)
void ipa_interrupt_deconfig(struct ipa *ipa)
{
	struct ipa_interrupt *interrupt = ipa->interrupt;
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;

	ipa->interrupt = NULL;

+8 −5
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/bitfield.h>
#include <linux/device.h>
#include <linux/bug.h>
#include <linux/io.h>
#include <linux/firmware.h>
@@ -114,7 +113,7 @@ int ipa_setup(struct ipa *ipa)
{
	struct ipa_endpoint *exception_endpoint;
	struct ipa_endpoint *command_endpoint;
	struct device *dev = &ipa->pdev->dev;
	struct device *dev = ipa->dev;
	int ret;

	ret = gsi_setup(&ipa->gsi);
@@ -858,7 +857,7 @@ static int ipa_probe(struct platform_device *pdev)
		goto err_power_exit;
	}

	ipa->pdev = pdev;
	ipa->dev = dev;
	dev_set_drvdata(dev, ipa);
	ipa->interrupt = interrupt;
	ipa->power = power;
@@ -953,12 +952,16 @@ static int ipa_probe(struct platform_device *pdev)

static void ipa_remove(struct platform_device *pdev)
{
	struct ipa *ipa = dev_get_drvdata(&pdev->dev);
	struct device *dev = &pdev->dev;
	struct ipa_interrupt *interrupt;
	struct ipa_power *power;
	struct device *dev;
	struct ipa *ipa;
	int ret;

	ipa = dev_get_drvdata(&pdev->dev);
	dev = ipa->dev;
	WARN_ON(dev != &pdev->dev);

	power = ipa->power;
	interrupt = ipa->interrupt;

Loading