On Sat, Nov 02, 2019 at 09:34:55AM -0700, Guenter Roeck wrote: > > static irqreturn_t ccg_irq_handler(int irq, void *data) > > { > > + u16 reg = CCGX_RAB_UCSI_DATA_BLOCK(UCSI_CCI); > > struct ucsi_ccg *uc = data; > > + u8 intr_reg; > > + u32 cci; > > + int ret; > > + > > + ret = ccg_read(uc, CCGX_RAB_INTR_REG, &intr_reg, sizeof(intr_reg)); > > + if (ret) > > + return ret; > > + > > + ret = ccg_read(uc, reg, (void *)&cci, sizeof(cci)); > > + if (ret) { > > + dev_err(uc->dev, "failed to read CCI\n"); > > ccg_read() already logs an error message. > > > + goto err_clear_irq; > > + } > > + > > + if (UCSI_CCI_CONNECTOR(cci)) > > + ucsi_connector_change(uc->ucsi, UCSI_CCI_CONNECTOR(cci)); > > - ucsi_notify(uc->ucsi); > > + if (test_bit(DEV_CMD_PENDING, &uc->flags) && > > + cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE)) > > + complete(&uc->complete); > > + > > +err_clear_irq: > > + ret = ccg_write(uc, CCGX_RAB_INTR_REG, &intr_reg, sizeof(intr_reg)); > > + if (ret) > > + dev_err(uc->dev, "failed to clear interrupt\n"); > > ccg_write() already logs an error message. OK. I'll drop both errors. > > return IRQ_HANDLED; > > } thanks, -- heikki