Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0571f6f5 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by David Collins
Browse files

spmi: pmic_arb: remove struct pmic_arb_irq_spec



struct pmic_arb_irq_spec serves no real purpose. It is used only
in the translate function and the code is much cleaner without it.

Change-Id: I4daae954b8e01b33a9c7f5a343a31c15b4787382
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent a5a32ced
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -707,12 +707,6 @@ static struct irq_chip pmic_arb_irqchip = {
			| IRQCHIP_SKIP_SET_WAKE,
};

struct spmi_pmic_arb_irq_spec {
	unsigned slave:4;
	unsigned per:8;
	unsigned irq:3;
};

static int qpnpint_irq_domain_dt_translate(struct irq_domain *d,
					   struct device_node *controller,
					   const u32 *intspec,
@@ -721,7 +715,6 @@ static int qpnpint_irq_domain_dt_translate(struct irq_domain *d,
					   unsigned int *out_type)
{
	struct spmi_pmic_arb *pa = d->host_data;
	struct spmi_pmic_arb_irq_spec spec;
	int rc;
	u8 apid;

@@ -736,10 +729,6 @@ static int qpnpint_irq_domain_dt_translate(struct irq_domain *d,
	if (intspec[0] > 0xF || intspec[1] > 0xFF || intspec[2] > 0x7)
		return -EINVAL;

	spec.slave = intspec[0];
	spec.per   = intspec[1];
	spec.irq   = intspec[2];

	rc = pa->ver_ops->ppid_to_apid(pa, intspec[0],
			(intspec[1] << 8), &apid);
	if (rc < 0) {
@@ -755,9 +744,9 @@ static int qpnpint_irq_domain_dt_translate(struct irq_domain *d,
	if (apid < pa->min_apid)
		pa->min_apid = apid;

	*out_hwirq = spec.slave << 24
		   | spec.per   << 16
		   | spec.irq   << 8
	*out_hwirq = (intspec[0] & 0xF) << 24
		   | (intspec[1] & 0xFF) << 16
		   | (intspec[2] & 0x7) << 8
		   | apid;
	*out_type  = intspec[3] & IRQ_TYPE_SENSE_MASK;