Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2965991pxb; Mon, 17 Jan 2022 09:07:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVXC38+lfBKZ0CoIf8sQb7L4hMgc15bMwmexjT4AM3uioOzVVjlru+BV7/48BlPmt6yaRx X-Received: by 2002:a17:902:704a:b0:14a:b62b:f41b with SMTP id h10-20020a170902704a00b0014ab62bf41bmr6718486plt.93.1642439267391; Mon, 17 Jan 2022 09:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439267; cv=none; d=google.com; s=arc-20160816; b=eEj5bxEy8+YdDqV7jupy+I3xvJwkCoN1dnppGilxxTy/teaAoeRv3LtdxwYBBuo+8C lIg+K4JAfjf2396P/GxvoozjFflzcBTbu114ov1fpsxdLo28f9wRWwq+1Ne0sxj+d2bG 8sWYc0hrB7EYWwG3J/aXZcHOHcLJSf4yAHLTdOGA/vKq7Qk8i22JrVaBinkrI9J+RJ70 ky7wa/XWelgX3kEh/rpaIkR+1VDI3HWW9VHZs41UZedphvpYnBXSvw1lADVJB/+cJFSN iEKm7jKUopb+TPPjEJBmDXXHXvYLUHYXlBTWypE9YvfR6VsoiOPIK13H48WL1KD+ITBY Ao/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=u6gDfYz5XK3BoOih3zuPlIJCbUaQgDeict/aTqmu/uM=; b=0J8y2JORBPHoiTdaAb2jeJSJCQK40q/WlPkf0wR5O/wH5pYzCC0bQaehfj5If4DCzA XcMhZG50nPlrpqWT0pFYHCqXPLhvPVkxNlYRg8vviwKH+VcFMSGG4eOjSz5uNmM2jYbq VZaopkJ5v/4bjROfca8X3VdzQHUsdfD5SjY53kQ4bGIKIEW8JzHsEeQy3+5zU/807wvf bxx0YpClbEcP33n0HnlZLVfeyVlAC4Tzly7fXYQMkTuEZF/+yD1J5HHOdC6mGCzYR5KE nwhlhAKAk//vS6olznuugoGsWY4vauASNeKydTYrfq7Cz85guomRMPoYZtIvaKEAi6Qu /+PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="iSOe/tpA"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v36si15892568pgk.464.2022.01.17.09.07.35; Mon, 17 Jan 2022 09:07:47 -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=@chromium.org header.s=google header.b="iSOe/tpA"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238502AbiAQKFW (ORCPT + 99 others); Mon, 17 Jan 2022 05:05:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238473AbiAQKFV (ORCPT ); Mon, 17 Jan 2022 05:05:21 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04AFCC061574 for ; Mon, 17 Jan 2022 02:05:21 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id n137so14842867iod.4 for ; Mon, 17 Jan 2022 02:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u6gDfYz5XK3BoOih3zuPlIJCbUaQgDeict/aTqmu/uM=; b=iSOe/tpAkwoCHPr7fqp3jd6szzLu83DiXOeN9DKlmNtzauUj0iVLlJ1T3qwaenz+pI ymL2xsF44k9NC5Yds8oqf5vBHUcLF5hHnw+jHM0CnV6QZih6a6rNVoYdnSLApaVADng9 l75A0igiz9pk0tzYQEYjMlaydyWtcb19HYCxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u6gDfYz5XK3BoOih3zuPlIJCbUaQgDeict/aTqmu/uM=; b=BBGyIOwWrmPtt1DVvetwsCRU/fTb7dgivXvYWP43i2lpLJyMQzVOM8RBQh6PmdMuIZ 6KkNsgAC+lPU9njsxjuc6bez1jXQjdFNH+gj/U+g388J4/AWl2jxFkwUG13UaHcGfndn SOHJ/KLGuTFnbYWrwWyS9S50r6gVDXUnbmmCBxZQ9H+P4HbRcnilBjfLchIuJnUL+GCZ KQH4E40QS02q+dseUzcpemc6L8mwSIlFAJ0Qy1SiiMUJWp39cMLOJGclE6r6VesDjuBM rFaKofNLe1EZFb/XtXPz6e3fO2+CrMacyHNB/rzSOMpoflc3KgDUtAhLIeIFrJV7MsKm 96AA== X-Gm-Message-State: AOAM531IYubGmUBSUQphssXMHeKMBztpJwidoH7vQ7PmdelTLRsJQjny lMao8zFZpHUmf8HXOqu68W8+Wx6963CR/zcoTEm1qQ== X-Received: by 2002:a05:6602:490:: with SMTP id y16mr9860884iov.162.1642413920295; Mon, 17 Jan 2022 02:05:20 -0800 (PST) MIME-Version: 1.0 References: <20220113082918.2279347-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 17 Jan 2022 18:04:54 +0800 Message-ID: Subject: Re: [PATCH v3 1/3] drm/bridge: anx7625: Convert to use devm_kzalloc To: Robert Foss Cc: Rob Herring , Xin Ji , David Airlie , Daniel Vetter , Laurent Pinchart , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Maxime Ripard Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi Robert, The second patch depends on "drm/bridge: anx7625: send DPCD command to downstream" (https://patchwork.kernel.org/project/dri-devel/patch/1f36f8bf0a48fb2bba17bacec23700e58c1d407d.1641891874.git.xji@analogixsemi.com/). But I'm waiting for Xin Ji's response for that patch. Thanks On Mon, Jan 17, 2022 at 5:40 PM Robert Foss wrote: > > Hey Hsin-Yi, > > > On Thu, 13 Jan 2022 at 09:29, Hsin-Yi Wang wrote: > > > > Use devm_kzalloc instead of kzalloc and drop kfree(). Let the memory > > handled by driver detach. > > > > Signed-off-by: Hsin-Yi Wang > > Reviewed-by: Xin Ji > > --- > > v2->v3: remove kfree() in anx7625_i2c_remove(). > > --- > > drivers/gpu/drm/bridge/analogix/anx7625.c | 10 +++------- > > 1 file changed, 3 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index 0b858c78abe8b6..d3661c78770a8f 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -2515,7 +2515,7 @@ static int anx7625_i2c_probe(struct i2c_client *client, > > return -ENODEV; > > } > > > > - platform = kzalloc(sizeof(*platform), GFP_KERNEL); > > + platform = devm_kzalloc(dev, sizeof(*platform), GFP_KERNEL); > > if (!platform) { > > DRM_DEV_ERROR(dev, "fail to allocate driver data\n"); > > return -ENOMEM; > > @@ -2527,7 +2527,7 @@ static int anx7625_i2c_probe(struct i2c_client *client, > > if (ret) { > > if (ret != -EPROBE_DEFER) > > DRM_DEV_ERROR(dev, "fail to parse DT : %d\n", ret); > > - goto free_platform; > > + return ret; > > } > > > > platform->client = client; > > @@ -2552,7 +2552,7 @@ static int anx7625_i2c_probe(struct i2c_client *client, > > if (!platform->hdcp_workqueue) { > > dev_err(dev, "fail to create work queue\n"); > > ret = -ENOMEM; > > - goto free_platform; > > + return ret; > > } > > > > platform->pdata.intp_irq = client->irq; > > @@ -2637,9 +2637,6 @@ static int anx7625_i2c_probe(struct i2c_client *client, > > if (platform->hdcp_workqueue) > > destroy_workqueue(platform->hdcp_workqueue); > > > > -free_platform: > > - kfree(platform); > > - > > return ret; > > } > > > > @@ -2666,7 +2663,6 @@ static int anx7625_i2c_remove(struct i2c_client *client) > > if (platform->pdata.audio_en) > > anx7625_unregister_audio(platform); > > > > - kfree(platform); > > return 0; > > } > > > > I just had a look at applying this series, but it fails to apply on > drm-misc-next today. > > Could you send a v4 that applies cleanly, and I'll try to be quick > about applying it. > > > Rob.