From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 28CDF3D092F for ; Tue, 23 Jun 2026 10:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782212069; cv=none; b=SGo8XW6jV9pTIP44YD1ExSvG9aUr3ggebwfN91+0lID1llod81gjkxoYZSzqzAwRt2h6lGW7O1uEuwh73y62tq/+fqTcrkVteOSkiDDcdtScvvOO02qYQ4L0SPVf49PtScC/GcY7VRPEj5d16jjnnjPWqLDxpBkhT5qhfzi9Zi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782212069; c=relaxed/simple; bh=3+cV/NKPssPEg2R6Cmh9eMoc75Lw0+c1VYJ0GE5YGWo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GPLKGxYyEU9uE1kHuVfhegRcFxsbJyQVdLs0oDjh77ZqTD2lb/YItGf/fOVqoDHtmvOUWz4b1YcXX9k/OIWDChxwX5IcqJiRER0C2mcuLiPTZAXZcNUcmAC0OYMlrEmdMsq2kX9U1ryownJh67Ye4zDLgUO+2GM4egLj7/ZxkdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=m/rEn9M7; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m/rEn9M7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782212067; x=1813748067; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3+cV/NKPssPEg2R6Cmh9eMoc75Lw0+c1VYJ0GE5YGWo=; b=m/rEn9M78kUV0dnv9lk85HCRMDwBjQ7Jo/zcjoDRIhnkbXXGDI7B30JH MD9NuHc+N4jVBhZFy9hfUfWoqoU3mmLlPlGyfLjiM8GBwv+6SECyLhYJb cKLM53Zt6rzkOA0tLWsHGQ6B/zkqykA3os85kq3tZNYstawF5/3irmp5Y JArRDldUGBAPNE/02B5eqRau/qNkMFMJTTJvVOFKuHNZnf5ds5MYoQhQ+ xNV6IdPRdibsZgEfkh3o2u+4mKns19t3+6q9bDhDupzJMJ2v3cIAximav 5eHh8j8pA1m/JBjfyPhVM2WHjS/dyjA6p3qq55EbUSxxAEf+YPeF9Mtfr Q==; X-CSE-ConnectionGUID: eKKzcSeHStWFUJrJjd2zuw== X-CSE-MsgGUID: Mv1zGcYNRi+Is8/56ZXTNw== X-IronPort-AV: E=McAfee;i="6800,10657,11825"; a="83140420" X-IronPort-AV: E=Sophos;i="6.24,220,1774335600"; d="scan'208";a="83140420" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2026 03:54:27 -0700 X-CSE-ConnectionGUID: zJm17iTsSFyKrz3qAwQDfA== X-CSE-MsgGUID: BxWKVuh4Ql6siAOUuaYliQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,220,1774335600"; d="scan'208";a="273183758" Received: from klitkey1-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.7]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2026 03:54:23 -0700 Date: Tue, 23 Jun 2026 13:54:21 +0300 From: Andy Shevchenko To: Heikki Krogerus Cc: Rodrigo Vivi , Matthew Brost , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , Raag Jadav , "Michael J . Ruhl" , Mika Westerberg , Riana Tauro , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] drm/xe/i2c: Handler for SMBus Alerts Message-ID: References: <20260622114759.3464047-1-heikki.krogerus@linux.intel.com> <20260622114759.3464047-2-heikki.krogerus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260622114759.3464047-2-heikki.krogerus@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Mon, Jun 22, 2026 at 01:47:58PM +0200, Heikki Krogerus wrote: > Some devices that are attached to the I2C controller use the > SMBus Alert signal for example to inform the host about > thermal events, so registering the default SMBus Alert > device device for them. The alert device makes sure that > the alert is processed and passed to the correct I2C client > driver. ... > + if (i2c->smbus_alert) Unneeded. Also the below incorporates error pointer cases. > + i2c_unregister_device(i2c->smbus_alert); > + > if (!i2c->irqdomain) > return; ... > +++ b/drivers/gpu/drm/xe/xe_i2c_smbus.c > @@ -0,0 +1,59 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Intel Xe SMBus handling > + * > + * Copyright (C) 2026 Intel Corporation. > + */ + bits.h // BIT() + err.h // IS_ERR() > +#include > +#include > +#include ... > +static struct i2c_smbus_alert_setup xe_i2c_smbus_setup; > + > +int xe_i2c_register_smbus_alert(struct xe_i2c *i2c) > +{ > + struct i2c_client *alert; > + > + alert = i2c_new_smbus_alert_device(i2c->adapter, &xe_i2c_smbus_setup); > + if (IS_ERR(alert)) > + return PTR_ERR(alert); > + > + i2c->smbus_alert = alert; > + > + return 0; > +} As per above comment, this IS_ERR() is not need, as the removal API is optional-aware. OTOH, the other NULL-check in the driver in that case needs to be IS_ERR_OR_NULL(). But I'm not sure if you want to have alert setup to always succeed. -- With Best Regards, Andy Shevchenko