Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2958879lqo; Tue, 21 May 2024 02:30:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPvKbJuEjR3AAhknH31hJtVKATkMs7kSYQpbe3vv8Q4Wxu14emZHpHahqarhzM4hz/R6Sh0RlzBQmwIZoWfN7UoZRVoTfyFBBfm4DpGg== X-Google-Smtp-Source: AGHT+IEuiV6V7RdujCWB+VXEcOuls5olVXyIETz1jH0wYAxpW6qvsCXJRsFvYLZempfpWibGFx51 X-Received: by 2002:a05:6512:3d1e:b0:51e:b5b6:29fb with SMTP id 2adb3069b0e04-5220fb6b0f8mr29400424e87.21.1716283837918; Tue, 21 May 2024 02:30:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716283837; cv=pass; d=google.com; s=arc-20160816; b=SPHudYMixKfSztimRIlyD76FTzu9K9BUt0rekKLTieBiZrxtfkybwHhqNjWcEve7pw ry67dWvUeg3XJ22pHnecEO0ul3QLWiNi/ZUaNTqCefWrE+Ztam8Vr/ySvgd/tCmxMlKj /j6+GGY2h2Vtqio2VTth1qUcmksAxCw+FjJnCKHLLTsmDj2pi9dSTiTxrEAMG/WULUbw J8fcqS75BghleBkefje50v2JIe1b2Uw+9MFJZePNy3BwRg0SPE3ikaBMlCICOgV5sysb MoN+XGNchFzHWMjORtMkav/A1vuoZZn9WuIQp2eIiN1ZAve4mC6EOPH9r4Sg7eujTj6F QC6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Ly/W78uX0/ie2exCRrH/dfYFyeE26dIZfFBpTQqeAnc=; fh=0y+mcr1HxMEL6yxBeJ2KH6XzQWVf5FTi0P47OPNhJuQ=; b=u59bzo5pNwnlKEZ1Hc1L4GUdYX0BFtT5gUyTiLsXj+YvrSYHwH4jzoPdafxxykvaYs LhqBva44aB7cKekDh4XZLj9f3zdXfZJgHDHwiq1xSR/7CBQK1GuDMWryvG5FdeTLUDZj C8M4UMGsD6nzjoSDIgDZ2/jex+u3niZ8e9wVpFbEod1uhOVG0P9lSWvzCUJpAee4mk+H p3gXKxCiD3dPvI1NksPz7xEQzd1oDQtBwEDClIPchAiLf/QzjCilQR9ZYlNc3FxfFvwQ MBJgP+M3mHGs4q+ZTGHaldeJrYab46uUySTJ95NgEygizILv8fDE1Ne2pkNlq1ajiQtv j0FQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOV95p0M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beac891si14550090a12.73.2024.05.21.02.30.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 02:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOV95p0M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 779E01F2296E for ; Tue, 21 May 2024 09:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB4A05B69E; Tue, 21 May 2024 09:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QOV95p0M" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EA32F3B1A1; Tue, 21 May 2024 09:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716283830; cv=none; b=uwEEbk105RYXahZoAwn0KmzAq3Tmk7DfDXlhg7e2/nHbh5aPY+nenN8IzURGkfUkB5X0buDeexGOFTxvw+la96fH5/J6S+Es/a6PPlo+OBVW/SuA0FjDLMlZ/k4aYmg0NLQK4oDvUNdAC6Odnntu0eL+hCHjDKLeTFlLtmq2kzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716283830; c=relaxed/simple; bh=dK7zzThPWoX0Tl/h413qAPmj7A3KkKjcLZB+0ecLH1o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LuwiJp9XAwpdU01w84OrbZ/s7H2WOSbX4P5UAHf3rFOt3pBE/Co0S4OwE9/HO2n87fBVkfCcnJsptnv4qNcKufW2aeEjh0mOSjLDSW/JgQg4isgWRop3AS44klK9Pz2YAhy/kfl2b8c+kNT86QP5hD+N6MWn0Ll94oMeKpNA1d8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QOV95p0M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E071C2BD11; Tue, 21 May 2024 09:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716283829; bh=dK7zzThPWoX0Tl/h413qAPmj7A3KkKjcLZB+0ecLH1o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QOV95p0MwWmW0FKD2XbVKxIjoQAppi/NX9+/wU29NCp/RXB29DzQPbF10NVE5vLUJ lqtBOvgI01OiyXmRKf6IszObIIItcD/drHBtiwjragDmbnDN1JEZfZ+fLNGsUN+iG2 ay6kDfdUO3nxEPuBwnuCHEmzgsAGT2NnEsYCERLSzYyK7r4TTnewguQg0HyxFpVTYa yfgfULe9H8Gn6bAb5CO7zebi2njO8/b38rjxjZM0l4vLY132LBdDnri/Boxar+JmLx 6qHqFql9LJ/fMzI3aw+x75d8bVNkyIkl2uoMzd2+xOIySGKWSKsxbDs9a2olMB5K9N 7zr2eJ+njU8oQ== Message-ID: Date: Tue, 21 May 2024 11:30:18 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 02/10] drm/bridge: add common api for inno hdmi To: keith , andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, xingyu.wu@starfivetech.com, p.zabel@pengutronix.de, jack.zhu@starfivetech.com, shengyang.chen@starfivetech.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240521105817.3301-1-keith.zhao@starfivetech.com> <20240521105817.3301-3-keith.zhao@starfivetech.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMB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L6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20240521105817.3301-3-keith.zhao@starfivetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 21/05/2024 12:58, keith wrote: > Add INNO common api so that it can be used by vendor > drivers which implement vendor specific extensions to Innosilicon HDMI. > > Signed-off-by: keith > --- > MAINTAINERS | 2 + > +} > + > +static u32 inno_hdmi_i2c_func(struct i2c_adapter *adapter) > +{ > + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; > +} > + > +static const struct i2c_algorithm inno_hdmi_algorithm = { > + .master_xfer = inno_hdmi_i2c_xfer, > + .functionality = inno_hdmi_i2c_func, > +}; > + > +static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi) > +{ > + struct i2c_adapter *adap; > + struct inno_hdmi_i2c *i2c; > + int ret; > + > + i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL); > + if (!i2c) > + return ERR_PTR(-ENOMEM); > + > + mutex_init(&i2c->lock); > + init_completion(&i2c->cmp); > + > + adap = &i2c->adap; > + adap->owner = THIS_MODULE; > + adap->dev.parent = hdmi->dev; > + adap->dev.of_node = hdmi->dev->of_node; > + adap->algo = &inno_hdmi_algorithm; > + strscpy(adap->name, "Inno HDMI", sizeof(adap->name)); > + i2c_set_adapdata(adap, hdmi); > + > + ret = i2c_add_adapter(adap); > + if (ret) { > + dev_warn(hdmi->dev, "cannot add %s I2C adapter\n", adap->name); > + devm_kfree(hdmi->dev, i2c); Hm, why freeing? That's a devm. You don't free other pieces in bind paths... > + return ERR_PTR(ret); > + } > + > + hdmi->i2c = i2c; > + > + DRM_DEV_INFO(hdmi->dev, "registered %s I2C bus driver\n", adap->name); Please do not print simple success messages. Tracing tells you this and driver should be quiet in typical cases. You have also some weird tabs instead of spaces here and there... like before 'encoder' arguments. This is needs some basic style check. Best regards, Krzysztof