From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27B3F3655FA for ; Fri, 14 Aug 2026 22:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786746581; cv=none; b=ChCSRE8gnQjQ54j2fMRVEYVHzGFNuUnbnyi3pAd6EweyBp5l1cSGB9qamFXvThoz4qBK6WNRsswxha4ONVJHVjGkCEYfJLYcJm7UwSaNA3QLdr9uMDWqXrgDgCm36dagPkF4fK4j1otaDzRvcUBIguYEbslMPTuzngWoiygF0iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786746581; c=relaxed/simple; bh=88xvazfiyDJvxemmT7YiwI4CUasBJNtOlR8LZ2zzVMs=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=E7/RQeddCRYNnE82DQAsaG2e37gKYulWJ22O7pi/BDCh4R9/HWqryo1P6hr3sTS9yChhbVymdIbf3ez4GQtjLrtKQ07TU7jmUN6C37h0b0VXLoW7OR4o6wE3meiVXKzxpUxXbJJOBK0urxnJ59wq1lPScZv5OdiBS/wJo3KIOyc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UnhScjQ7; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UnhScjQ7" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-495757ccbc1so13567625e9.2 for ; Fri, 14 Aug 2026 15:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786746578; x=1787351378; darn=vger.kernel.org; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=4ikckCEzn9xT1LxvvFLKu0gXourO5git68rDM9mwEXE=; b=UnhScjQ7e/aOBY9sRvkhwoH38E1MRve/yogSHJGraBTaENr4NVRghSUwg/ZGweKZm9 cU18oc8HHhwZ5t4Slx17/XtxZjfERnDvShkbmI6k+/42Uh/K3c9EKtzkPiI8QJjbA+5F RscKYU/r/kbO68vT2NFK8NlFDOJGpLkTqRvo/A8z40/zMad6SIbeb1+i6eS+hh8xCWxl chJHMviMUlpakYn4URx+Ux7J85lpcw9V+zOzPLWl1aYrU7ujzWeGP52J9mxh40hyA/m9 qUh+NBmr/KOZqIbBUA4iv5oRdgLoHZXy9gotrkJkmHy53/rkcqCdGMSOe+qPZVybSYz2 pBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786746578; x=1787351378; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4ikckCEzn9xT1LxvvFLKu0gXourO5git68rDM9mwEXE=; b=qVa4dUt4+RtDxichqPsXwMjDM7S8y8zl7wOH4gZMB6CD3CT0dd04H0SXJEag2zhVTY SLgi/buIJPMMcbBzedMBtk9Kvjc1aMAHfewNE0uLKzkzG50JL734OAB6PmkHA3mka6Rm JdhsO8IswI3H/69aSgQupgzqISDG3xCuTXxNxGJPvSowk1k1o7bU/HAsjgyFNJ8BMFLJ gYe/6WGzUxJ3Oa+FQHqWllC2r/FOBQE1tzN2/JZ7Lm6khJNO8YXZYimKmFGPVjl/im0a cbs8fhkVmeqL58dpCOV80Yu2R73c8EEL4SY8+UwtRVdPfygkv4ZzL9vHs7zsL+SEzohM Azew== X-Forwarded-Encrypted: i=1; AHgh+Rop0qYl/+0U8GrszUuDppji4zUPUHKv6lB9yCoAg/tjnQGdlc5pu/+ohA21STTstzmgWDfVZFdD9EtGqSU=@vger.kernel.org X-Gm-Message-State: AOJu0YxsOARGNaMgYN9bdm4fHsK+j/sl4+tVQLNSal5SpoEkMN5rpsw+ 7lxgoeSI+4CAzY0N0DU9nUdLvfnkbEe4zoI3D6dFVsgwwURonoKHCmdN X-Gm-Gg: AR+sD12SvH4A/jvo51nHeWh/zHs1Wi16Vmge5LzDXK2YVAkJ2uAZ8EFDDOE9rzYOhf9 GwAy0SDO4XD5dLGk1Txk7SqLZ1kcke1h2uT6EvoXgd6cFfnKLqZVD+BE6JibqmreAg1DEbzyKyS /o6rKEAQBWqRFCDDOq1wpHb7yn0+TmX6FvXnbt6jRg0qmb6K6wEt+UPgtGfpTtKqadr1my1lhP+ XkRpFciSny49bNHhZwaF1MjSLXqK566VFj38mmyLCdR7Wf20baKr8faY73rSEOnhGJp0y9jgo2+ hiHbTQisnvGAb8C4EA6etLGUm8NhaJ//ruyxgyKci15F7z7xKTIG4EuvC7IACAIuW0055kD4i13 i9zFiDiO+ZlFVVh5XSCU5/BsfxcWYVMCe+G2QHhOiikyjxQUq4AqoWGXm+b5Rf/S8qciZhxzfzb n1ti7kCJ9w79ds6HPyZyGbeTQjjDMHEGTiHY3jgjhkb+0NcJK6NhKzTC7LLaHYOuO7eoTj3rkO7 Z8tvSKZrAdD5g== X-Received: by 2002:a05:600c:6b72:b0:499:7a19:408b with SMTP id 5b1f17b1804b1-4998795f96bmr102384785e9.11.1786746578439; Fri, 14 Aug 2026 15:29:38 -0700 (PDT) Received: from localhost ([2001:4bb8:16f:15e0:4de3:7ab4:f4f1:da62]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4998bc827f1sm60227755e9.6.2026.08.14.15.29.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Aug 2026 15:29:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 15 Aug 2026 00:29:35 +0200 Message-Id: Subject: Re: [PATCH v6 4/4] iio: light: veml6031x00: add support for events and trigger Cc: , , To: "Javier Carrasco" , "Jonathan Cameron" , "Lars-Peter Clausen" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" From: "Javier Carrasco" X-Mailer: aerc 0.21.0-143-g2f3a2e260c09 References: <20260812-veml6031x00-v6-0-7eef6e4ce290@gmail.com> <20260812-veml6031x00-v6-4-7eef6e4ce290@gmail.com> In-Reply-To: <20260812-veml6031x00-v6-4-7eef6e4ce290@gmail.com> > static int veml6031x00_probe(struct i2c_client *i2c) > { ... > + ret =3D devm_add_action_or_reset(dev, veml6031x00_disable_event_action,= data); > + if (ret) { > + dev_err_probe(dev, ret, "Failed to add event cleanup action\n"); > + goto err_pm_put; > + } > + I just realized that this action is added without taking into account if an interrupt is registered or not. It passes because the function checks if the events are enabled, but it is unnecessary if there is no interrupt in the first place. I will move it right after veml6031x00_setup_irq(), and when at it, I will take the whole IIO device initialization to a dedicated function to make it more readable. > ret =3D veml6031x00_validate_part_id(data); > if (ret) > goto err_pm_put; > @@ -693,6 +1212,20 @@ static int veml6031x00_probe(struct i2c_client *i2c= ) > if (ret) > goto err_pm_put; > > + if (i2c->irq) { > + iio->channels =3D veml6031x00_channels_irq; > + iio->num_channels =3D ARRAY_SIZE(veml6031x00_channels_irq); > + ret =3D veml6031x00_setup_irq(i2c, iio); > + if (ret) > + goto err_pm_put; > + > + iio->info =3D &veml6031x00_info; > + } else { > + iio->channels =3D veml6031x00_channels; > + iio->num_channels =3D ARRAY_SIZE(veml6031x00_channels); > + iio->info =3D &veml6031x00_info_no_irq; > + } > + > pm_runtime_put_autosuspend(dev); > > ret =3D devm_iio_triggered_buffer_setup(dev, iio, Best regards, Javier