Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2963340pxb; Mon, 17 Jan 2022 09:05:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv9kZkzYYfK7lWN8ti8VERA+f6p9wtQJ+g4HLExdprvCkvuZMr6K4GjUeJyx6FgIvZZv4c X-Received: by 2002:a63:6b81:: with SMTP id g123mr20225947pgc.140.1642439124410; Mon, 17 Jan 2022 09:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439124; cv=none; d=google.com; s=arc-20160816; b=pQzmI8FIC1/J3jI0ecWV2m/zKFVl3qsYTXbt7+9Ol7aPeSXrty069VCaRUniLymuSw dgPx0Rv1kY/5rsloLTpG/ij744R2JvEU0qjQNQwGR6BpCpvgysZ/F4Xkf7Er1WsegbtG 1itaTiY15n/UUfDfZmZiV/qfdwkcHWs5TVKW4LbZd610EVyxojeboX4x7lNqqM2LVw2d 5uxnaZ2/DAVb+sIrckCLYyZFXs2Q9zRvMlk9AFgjfNGQ+NXtsz8RucGbkI/HnyXV4ZcM B7/cRYkCsqVs3r7jp3rtDZiwk9j8E0M8jRAwHKPdLFtoKmZLePsvzrYeZ7v5wRUKNp8r ijaQ== 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=SIgYGrN4LwQTs17+VXthu1/mXIG34ztGcllpOGCYBUY=; b=iakNSPgQ66eF1FIR07Cb0u5zeLj+D+O6s5lTj/HrzloZNCLk6KZ7d9ZYm1Ivqfbon7 lBUIrtWGBVmGVYJ0/BPODmQNCwvKBblSsiKXiiz2yXrqhRTMig7sKHmQJY+znB/cF5vq ZKeVUw1B/X2Ir+hfMCC9S9IuHRRtFX4vcK2aAxNsChkWIC7V+KfpAAfnXXUxnD6wYnSb /sBP3HKPSy8jcOGsk2/8E9AOzXLUDK1D51HTQgkBbhtJcWDAFADm695FoCebUYsbzP+E jkEBoHUprd9v2+hn+Nqva2S09nRd8owG2ZolWaDBMF8kdfPlck1LKCq2y0edEmRNcpEQ XDEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xmwbCLYh; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo3si17075941pjb.164.2022.01.17.09.05.12; Mon, 17 Jan 2022 09:05:24 -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=@linaro.org header.s=google header.b=xmwbCLYh; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235950AbiAQJkB (ORCPT + 99 others); Mon, 17 Jan 2022 04:40:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235884AbiAQJkA (ORCPT ); Mon, 17 Jan 2022 04:40:00 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613E8C061574 for ; Mon, 17 Jan 2022 01:40:00 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id l21-20020a17090b079500b001b49df5c4dfso3077722pjz.2 for ; Mon, 17 Jan 2022 01:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SIgYGrN4LwQTs17+VXthu1/mXIG34ztGcllpOGCYBUY=; b=xmwbCLYhEE9bYLZqv0I8ALMO0V7d/Xi97LrM068AbIRSOFBFz8JsLtB1mgWWNRGesf N0fUx0p0QfouvE3r0dGowIIBaKql09cSLdkOlENedU7pO9TTq6mb6XQIWY/d2V9Ibp54 Wcd7sC9ZaSsMvkh2cPEcsaON2uKZeXtydaQi+g/ClzR+azMiZ/MtX74f+BTlsOkM0hfh SUsr2LcUVDEQzDMYEtPRt+ZXyQKXGqjdFDJyZRiJUok3HnC4JHUSO3t4MNSNMyJ3rVh1 hdOOuhJ5NeumWzaHP39f+EMxIwoXU4BCws14SmywAt+3b2rfrdGYRfJkGU/9bP/JVUi1 ElcQ== 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=SIgYGrN4LwQTs17+VXthu1/mXIG34ztGcllpOGCYBUY=; b=qbs+LEHkgz5BMCHwrZnLg9oNiJjSOlN5ANwcFstfYGVet+x5DfgAAPCfoZU5YS1Rzm oPxrDjs7hZKoxEJDhTQ3S4WI7eONKgupTmmnLmwSGPv5cdvWZQ2IybKEbpGpaB2yZncI ry7X5UAlTXWRGZqrGV2fII3KcyELWec+wVcJSb63zleB+Iq0u6uICJchu37zBSh4Ld/e zwvnHcfnpafiIMHx1EkLm4VMARUgXfauMatV9OuO5U8OSJK3EZEESP0evcB2f9WIR6jW EwstSjy6HOZRu8qZQZ3XOWHm5RM5Qkcj9cyTjMz7pQf0i2l+ZxMAib6JsEgxICFkidCA Fi4g== X-Gm-Message-State: AOAM532eutlhf4eNNjw6+SqaXZszjNe9DE6J6i4qDnOl+z3lqkwvq4Jr mUMva3v3m1fh1e/SBrdn8VOY71oCsG2tJ1lD1450XA== X-Received: by 2002:a17:90b:3e8e:: with SMTP id rj14mr17892801pjb.179.1642412399902; Mon, 17 Jan 2022 01:39:59 -0800 (PST) MIME-Version: 1.0 References: <20220113082918.2279347-1-hsinyi@chromium.org> In-Reply-To: <20220113082918.2279347-1-hsinyi@chromium.org> From: Robert Foss Date: Mon, 17 Jan 2022 10:39:48 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] drm/bridge: anx7625: Convert to use devm_kzalloc To: Hsin-Yi Wang 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 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.