Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752984AbbGaTmg (ORCPT ); Fri, 31 Jul 2015 15:42:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45738 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751908AbbGaTmb (ORCPT ); Fri, 31 Jul 2015 15:42:31 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.1 028/267] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices Date: Fri, 31 Jul 2015 12:37:59 -0700 Message-Id: <20150731194002.822215800@linuxfoundation.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20150731194001.933895871@linuxfoundation.org> References: <20150731194001.933895871@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2658 Lines: 71 4.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Abbott commit b08ad6657aacf9b5d7c4b22de2ba891b152d0528 upstream. Normally, low-level Comedi drivers set an `insn_bits` handler for digital input (DI), digital output (DO) and digital input/output (DIO) subdevice types to handle normal reading and writing of digital channels. The "cb_pcimdas" driver currently has an `insn_read` handler for the DI subdevice and an `insn_write` handler for the DO subdevice. However, the actual handler functions `cb_pcimdas_di_insn_read()` and `cb_pcimdas_do_insn_write()` are written to behave like `insn_bits` handlers. Something's wrong there! To fix it, set the functions as `insn_bits` handlers and rename them for consistency. Fixes: e56d03dee14a ("staging: comedi: cb_pcimdas: add main connector digital input/output") Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcimdas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/staging/comedi/drivers/cb_pcimdas.c +++ b/drivers/staging/comedi/drivers/cb_pcimdas.c @@ -243,7 +243,7 @@ static int cb_pcimdas_ao_insn_write(stru return insn->n; } -static int cb_pcimdas_di_insn_read(struct comedi_device *dev, +static int cb_pcimdas_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) @@ -258,7 +258,7 @@ static int cb_pcimdas_di_insn_read(struc return insn->n; } -static int cb_pcimdas_do_insn_write(struct comedi_device *dev, +static int cb_pcimdas_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) @@ -424,7 +424,7 @@ static int cb_pcimdas_auto_attach(struct s->n_chan = 4; s->maxdata = 1; s->range_table = &range_digital; - s->insn_read = cb_pcimdas_di_insn_read; + s->insn_bits = cb_pcimdas_di_insn_bits; /* Digital Output subdevice (main connector) */ s = &dev->subdevices[4]; @@ -433,7 +433,7 @@ static int cb_pcimdas_auto_attach(struct s->n_chan = 4; s->maxdata = 1; s->range_table = &range_digital; - s->insn_write = cb_pcimdas_do_insn_write; + s->insn_bits = cb_pcimdas_do_insn_bits; /* Counter subdevice (8254) */ s = &dev->subdevices[5]; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/