Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3185937pxb; Mon, 9 Nov 2020 05:07:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2WepS5KHvqAjKqxjD8BvrzY9vu//qr0NnwcB37ddjLNFxjb5ukd8DztXolEzCEnha8HTl X-Received: by 2002:a50:a6d0:: with SMTP id f16mr14783489edc.135.1604927244167; Mon, 09 Nov 2020 05:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604927244; cv=none; d=google.com; s=arc-20160816; b=QVkJjGH65pIb4kcx8/psx4viheKN9w+7eMlkTGe+0xn1OHJInvSFJv1xHK3VsjxGx9 Ag6fOYcMehS0XLOl16OBbEtTXdug0RvExO5+7rXOUHeBfhEMpSAivoYJ4I0vv+1g7wA/ G8JmNdZ2vqr0T6N8wdOpi8S+SV0H7zy+1QKFraE2+CrnSPIIlPROEYGX+RLuVSf8vBaF N1dmFlC18sRDuT4Saz0Jmf9m3NEDEvOduUPtZFMmzwrTo2lH8zn/vB+KePGTh54W43wu /giv7rxVRWkG6J+fYYbyQZAyQlcQ+pRFmmSvP166rh/pvLmdLYQiCrm+fFGYvpYVfcYE 2mGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kwZaAYXIKFWGu5de1Ue5NR1V4bhkIZNNVeZ+jJOSth4=; b=BwSUvBga4WEEGnoLY9Us/F2SJMshxkbj2yhtSPLeiIlJEqk8Y86YqBUSSKDZvzQ3Mu mCsMSTBl6hlyZKrlvcokc9wAqOGJ6aF2MpawWpwl3xP0bUI3AdUMysR3JAPOnk8hgkGy fyEfmHcquRLtmLJLUOw5vgpCQE1Hkv+l8SLsdzbWGLB3pg3ytgo+W7B/2VoOuG0xHCvY pitd9nymbhMxFNvRJmkg/GjI/SDcOB0v4rest6d8U3NshNS+88kJ8Azx/ycw7OS2KtRh zj5ERbOA1sCPTpXVcE5a+95eQCsNxI8z3zFObnOhFoK/5OrLRRJ33Y0cqf3ysVXl/uaj iWjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Dqkf1ERM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si6528583edw.91.2020.11.09.05.06.59; Mon, 09 Nov 2020 05:07:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Dqkf1ERM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730844AbgKINFX (ORCPT + 99 others); Mon, 9 Nov 2020 08:05:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:57090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730330AbgKINDz (ORCPT ); Mon, 9 Nov 2020 08:03:55 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6762D2076E; Mon, 9 Nov 2020 13:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927035; bh=fkqM5AZp/l2Gs7sOGbuJAi/7dn1wY7QyPoAdZOGFS8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dqkf1ERMz59t7CY0CKRjraFXZGaZduogaVLtPn62GNIHeFlqt4Joa9KQ/MyUvU3fT 1M97xix+IFWXwp+BdVTy+Gfp/wEOa4dlRBR3a2Op5N20qq4JfrQyFExngsCwa1kQcG JUnvHNbitp8OsyVvimONWQiOkhzjSt4S6u7d2oLs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.9 089/117] staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice Date: Mon, 9 Nov 2020 13:55:15 +0100 Message-Id: <20201109125029.915906172@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ian Abbott commit 647a6002cb41d358d9ac5de101a8a6dc74748a59 upstream. The "cb_pcidas" driver supports asynchronous commands on the analog output (AO) subdevice for those boards that have an AO FIFO. The code (in `cb_pcidas_ao_check_chanlist()` and `cb_pcidas_ao_cmd()`) to validate and set up the command supports output to a single channel or to two channels simultaneously (the boards have two AO channels). However, the code in `cb_pcidas_auto_attach()` that initializes the subdevices neglects to initialize the AO subdevice's `len_chanlist` member, leaving it set to 0, but the Comedi core will "correct" it to 1 if the driver neglected to set it. This limits commands to use a single channel (either channel 0 or 1), but the limit should be two channels. Set the AO subdevice's `len_chanlist` member to be the same value as the `n_chan` member, which will be 2. Cc: Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20201021122142.81628-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidas.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -1351,6 +1351,7 @@ static int cb_pcidas_auto_attach(struct if (dev->irq && board->has_ao_fifo) { dev->write_subdev = s; s->subdev_flags |= SDF_CMD_WRITE; + s->len_chanlist = s->n_chan; s->do_cmdtest = cb_pcidas_ao_cmdtest; s->do_cmd = cb_pcidas_ao_cmd; s->cancel = cb_pcidas_ao_cancel;