Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp805213pxb; Tue, 3 Nov 2020 13:02:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQ09Qh8dvH6QTsPAI6/tYpN8W3XnwP8v8QwSnkLT4MD21QfiQlnbgbOag2WGjl+3b6raVB X-Received: by 2002:a50:a441:: with SMTP id v1mr23329326edb.30.1604437354061; Tue, 03 Nov 2020 13:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437354; cv=none; d=google.com; s=arc-20160816; b=ZMAsaveKq+ArZgKN+s7NShzUBKyotTf4vKc/p85D2e5bO/2kM8q/t3P+3m2S1vZzSh WD8dWnoyDXOgJwprNptu5Fp0ZASja+koGFqrb8QpSEeAuDK8fXHJylm6siDCXORfzyMJ L7DY0TbXiYERQGQEGSAq4wiaTJ39d7Efn1fy93Exnxm2/iIC0tpTe3/HEd9lCvakvSPK Z/xEyGJpM3l3mFAXMxZxBVOkI7Fmeb4UImGS6QZMRmEaoNIahI+VhasxoHbssRQ1U0yr GEjwWrloOLUgeEyc9g8P1t6gfNs/56fm5N1oTXchXxK/zWnwAX+VQwnSLfiMhyUvNv3D HPEA== 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=mQkgWr5rX6E9OlHSZygy7LhE9NY5xbABmHe0VEowaTI/KPbV8qUhi7jZq+yQqRBoq9 eGy5JPxrKYJX/f78/AwWb4hP2LDv8CXWUzIE4zNkodCRJ7UWfFTOlPZcQMeFSaqYRZzd OkdyLr2oqKMTaOkxmxIJlVsydaU2NCs2Mh/pkf+yLr3lAA0KOj7D6Yd57EQQlECEfs0C lDeb9TrwwDvipXHaoSdHmJ3WeTZxukKjOontcrfr5dWzjgFrFF0TjDM1UC/y8cDPa3j9 3C/C8ucTu53GObWvUhK6i8yEHy7KBqkZf5OJrjDkqTB5NljM5lE3YEVoIT1JdG+gXqAo K6iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1+A6b0+r; 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 co16si14060367edb.465.2020.11.03.13.02.10; Tue, 03 Nov 2020 13:02: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=1+A6b0+r; 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 S1733300AbgKCVAw (ORCPT + 99 others); Tue, 3 Nov 2020 16:00:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:36914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733294AbgKCVAu (ORCPT ); Tue, 3 Nov 2020 16:00:50 -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 D5912223C6; Tue, 3 Nov 2020 21:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437250; bh=R2uupPPjUrCiVXqiZGMwEogBjkihGfr35fgrFP4hGsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1+A6b0+rqKNb5ZCNSynuG4ikm8Y75aAWyvTKGMBj1m5FB9w0+xg963FZA4/nTDCPt uaxZgg86oOEUUdryI6IcrU0QAcCovTyA8FaI36W9vIwnPzbWcSI2lzfwZUeEjh6V/v dAkXftjMVDCKKsnAt8ZOdiEzIA5Rn2yTHqo5WoMU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Abbott Subject: [PATCH 5.4 211/214] staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice Date: Tue, 3 Nov 2020 21:37:39 +0100 Message-Id: <20201103203310.362981470@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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;