From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FE8F3002A8 for ; Fri, 12 Dec 2025 18:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765564036; cv=none; b=UGOuZlARgCZ7kSQ/NiUQpJonXmi/LA9U5ZD0lJ+WIDiAue/smLnG02k7ewY3dTWEifRMMfub/J8A/e41XRzBlSXKcvSMoU90+29KAcLJu0ydfh5lXylWFqBdKDoK92QWc8aCy3VPCFgnrBrZIsrxYpkD4dVE45jTYPsoTGxhPzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765564036; c=relaxed/simple; bh=BnmxK/gHlfgVlrkPliVviBYlifCofWtiW/GWzSlgkfM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mKoq96xUdQv4XB3JcivXxHlYUCQmK9CsTqCGmKiQpQIljvMgprMGGV4WS4My9RypPvAe2u7aAZdm30x+4QXC9scYchkAffnDpG/mL1pN2t7A0jhr6Rj1A0SP44fxmFMWmIoxGeDrMImS/vLxuQAL8qNG/E8Ko6hIvhi1jKGaLAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Jeu15aaB; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Jeu15aaB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765564035; x=1797100035; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BnmxK/gHlfgVlrkPliVviBYlifCofWtiW/GWzSlgkfM=; b=Jeu15aaBoRMYU/3Hru0Lz7czXjr/lyyiHkSbjbicMz0uQyj3UXCQh1ui H7k1ACFjHLA8gDCmaMoGT1lS1faPQrBWdUvlfwYBEZzEEnU6nXugwYlUm 02G0aS8w1VyViYPHIbrkZN4YWK4XT6t/gO7/BiBoQn5wTwGMdYZzY2G18 MnEaMoQlqMPuWGNl7D/G69qb+vvfm9VZPeSYLnrIwWpwnvpbL8nDIWJo3 Of+z0T3UkvaMWpSxVMsaNY7LPjVIzg+LKB2UY4Fut4NQgkU/rgsJgu4Xz JFoOKhBBCLZgFluE9V+/LdXXHwYRFIa9XYsG3Fe2LO8QBwXukOP9SNasQ w==; X-CSE-ConnectionGUID: RMVOEgcDQty0Wj/SbK5CrQ== X-CSE-MsgGUID: Ype5OJcKQQKwHkNUJAcm9w== X-IronPort-AV: E=McAfee;i="6800,10657,11640"; a="71200585" X-IronPort-AV: E=Sophos;i="6.21,144,1763452800"; d="scan'208";a="71200585" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2025 10:27:14 -0800 X-CSE-ConnectionGUID: gtWWtGVJRjm5ByqyIT+plw== X-CSE-MsgGUID: oVbz2Yc+SPqhIF8D9n1F/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,144,1763452800"; d="scan'208";a="197420834" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.181]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2025 10:27:10 -0800 Date: Fri, 12 Dec 2025 20:27:07 +0200 From: Andy Shevchenko To: Kurt Borja Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Benson Leung , Antoniu Miclaus , Gwendal Grignou , Shrikant Raskar , Per-Daniel Olsson , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Guenter Roeck , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Subject: Re: [PATCH v2 3/7] iio: core: Match iio_device_claim_*() semantics and implementation Message-ID: References: <20251211-lock-impr-v2-0-6fb47bdaaf24@gmail.com> <20251211-lock-impr-v2-3-6fb47bdaaf24@gmail.com> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251211-lock-impr-v2-3-6fb47bdaaf24@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Thu, Dec 11, 2025 at 09:45:21PM -0500, Kurt Borja wrote: > Implement iio_device_claim_buffer_mode() fully inline with the use of > __iio_dev_mode_lock(), which takes care of sparse annotations. > > To completely match iio_device_claim_direct() semantics, we need to > also change iio_device_claim_buffer_mode() return semantics to usual > true/false conditional lock semantics. ... > - if (iio_device_claim_buffer_mode(indio_dev)) { > + if (!iio_device_claim_buffer_mode(indio_dev)) { > /* > * Replacing -EBUSY or other error code > * returned by iio_device_claim_buffer_mode() In one of the previous files you removed a comment, and here it's still present. ... > - if (iio_device_claim_buffer_mode(indio_dev)) { > + if (!iio_device_claim_buffer_mode(indio_dev)) { > /* > * This one is a *bit* hacky. If we cannot claim buffer > * mode, then try direct mode so that we make sure Also check if this comment needs to be amended. -- With Best Regards, Andy Shevchenko