Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4482813ivc; Tue, 3 Nov 2020 13:12:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbvQRD3Izx/zTssT+7W/rXUKlmNYDT+tKA7JHMDp/lPk01JfcP4dJIk//2h2O4OcrBhWqr X-Received: by 2002:a05:6402:287:: with SMTP id l7mr23227210edv.212.1604437954368; Tue, 03 Nov 2020 13:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437954; cv=none; d=google.com; s=arc-20160816; b=UixFovma1RL/ASC+A4o9PHhP6JNUAkzpJIE42/wRes8CQQfBW+J+4u08bU0curJQ+p f5Eyan+B8r6yf+Rq/wrAVW2sthgcmnFR3NlP5HVb3/DQWDe2fqHhFrmyJ0I4rEB8WnjN jiax6UWkzjX6mjDaSFBS+uW5ordTvoUYdxbbqWpsVa66b+5rzA7HVAl8dQV5j5Px5tWy Bmzra724gvC8yckOLTY3XlBB9wfGc44bSBK2GHX+oo8/t/oTTE36JjFdIXVBm0bMWhej KIf7XFsXWt+GKjLdzmdRnDtCkOUAQp9Z/ugaztY87nFEBsronISaaKJUvWc86W/Ly6RK w16w== 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=+T0EkNLPE+EJNKZxAqX1QLZKfQkORgxoUrikhUjUnj4=; b=T8UzUv8j/+hvvvTXVbkTy9yYEpBZplz7IDeF3khgCl4gTdCqGfRHJSWWuiQESDiN9l upE4vCkutTWcs824GyGtT2X9IOb+cDYHQKx7zVzGGd0uQaR8uVG6y4Wrus5aEBEIQUdn AL5eIwFj8rtS/bf4orvL3xzjJ8QQlFgUaqyda/14SN1Olemf4pfCWxD8uAeHUwqhxdMV HvL+TeIdZq+wi+z+DlYk1ly7VLo0XvJm5ate7iW7Xgl1QPjTuG2FFvkcecHAi0Txtenj hPibKnf5mh5LCsESRGKa24fuzcxHKiBBqMEuGlH5o2LR4puvIXrLqLN5+9O97MiyHgq4 dHfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rp6cdhp6; 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 y23si5680380eds.334.2020.11.03.13.12.11; Tue, 03 Nov 2020 13:12:34 -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=Rp6cdhp6; 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 S2388111AbgKCVIZ (ORCPT + 99 others); Tue, 3 Nov 2020 16:08:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:47788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387682AbgKCVIY (ORCPT ); Tue, 3 Nov 2020 16:08:24 -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 1DB17207BC; Tue, 3 Nov 2020 21:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437703; bh=R2uupPPjUrCiVXqiZGMwEogBjkihGfr35fgrFP4hGsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rp6cdhp64nYGya9SbW4xDCvUFqcEWV/LdhfnIaZRNeKGKaCysfw06Ww6mMmwQ4Ioh QsEvBuqTTV/8R397cHpkXqtX0tar2vYQfY7pi8rqhXOsHlHdrn8gth0k57+3SS1peb +dmPkWA9Epic+jDRaWeSfj2Br0d8M5rUiNrD0n3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 4.19 189/191] staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice Date: Tue, 3 Nov 2020 21:38:01 +0100 Message-Id: <20201103203250.540817459@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@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 @@ -1342,6 +1342,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;