Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5674352pxb; Mon, 14 Feb 2022 05:05:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhkoRMKQ1vioxnI0wYNLwXjsJoUuugdO9dIFAl+y41MJl2XBSCVON8sq3uJGU4YEjSN1o/ X-Received: by 2002:a05:6a02:10e:: with SMTP id bg14mr6071544pgb.601.1644843924291; Mon, 14 Feb 2022 05:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644843924; cv=none; d=google.com; s=arc-20160816; b=XcsUYQ8jLUu/iWfxdtE5CZKlzBUTA6DVUSzQgydvFOCK5X46G7JFGydqjumbn/JkdO 4fNo1TuS4G8jeiRDCRDxXBGmxyTbWOmF8lfcJqJ6DB0ZiyBBmm5QTGaKBe7qsJtZTCT3 F4sNWoDPbEEvzaDcS51MgPWOPltb8ewDH/A6kohFejSyCDlFYNRYTqA3pFinIMughSoc jCaHAX/++4JIyXnbEtFdsfU3U/2D8Q3Uyj4CHlFJWByPvVD8rmYA6RPO3VTKomUaLjHb 8GyvBOt911V9oBPn0YI0j7UqKlvL4csHBjqmS3GvQZmQvMfoAY1TjirbLSyp+1J7S6Ln J0cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date; bh=P3Hyla16zT9IYarG8qATlbTHC8kidXTum7h+qPPZoJQ=; b=TP4o8JRFxhj55Pl+yyBfBaO07xqgiSORUgzwJOWwIxSEYp5UxFQZhVONlhpOF32vM8 FjhRplnRL0P+Z4YDA/YfpC6f/Rlv/evBaccIP5hj/ugttANyBetSbbwlu/PKKh2WIftZ SOJY5c+gQcSDhGq91rsGSd75dc82n7YdojGMz/QHOL2IL9EwvIh0l/IeiczyIQUgib97 e+4UDmsj62WYbjlJimsI+boGyyYXTVF1mTrYOD9Ey2xS/oEk4eqhgnB76TSK/IQ7sS/m rhDi5yeyoHw+71NqPbBw2bY2xyInnp1o4zP/BNv40K0Y8GX7uy8V68D4Pl6nBO28RGfK hNwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc15si2424751pjb.67.2022.02.14.05.05.07; Mon, 14 Feb 2022 05:05:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352256AbiBNLrC convert rfc822-to-8bit (ORCPT + 99 others); Mon, 14 Feb 2022 06:47:02 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352300AbiBNLjq (ORCPT ); Mon, 14 Feb 2022 06:39:46 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD4C1DA46; Mon, 14 Feb 2022 03:31:12 -0800 (PST) Date: Mon, 14 Feb 2022 11:30:54 +0000 From: Paul Cercueil Subject: Re: [PATCH v15 2/7] drm/ingenic: Add dw-hdmi driver specialization for jz4780 To: "H. Nikolaus Schaller" Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Paul Boddie , Laurent Pinchart , Jernej Skrabec , David Airlie , Daniel Vetter , Maxime Ripard , Harry Wentland , Kieran Bingham , Jonas Karlman , linux-kernel , dri-devel , linux-mips , Discussions about the Letux Kernel , Ezequiel Garcia Message-Id: In-Reply-To: References: <58IA7R.PZ9FQXN7FVAK@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le lun., f?vr. 14 2022 at 12:02:53 +0100, H. Nikolaus Schaller a ?crit : > Hi Paul, > >> Am 14.02.2022 um 11:24 schrieb Paul Cercueil : >> >> Hi, >> >> Le sam., f?vr. 12 2022 at 16:50:50 +0100, H. Nikolaus Schaller >> a ?crit : > >>> +static void ingenic_dw_hdmi_cleanup(void *data) >>> +{ >>> + struct dw_hdmi *hdmi = (struct dw_hdmi *)data; >>> + >>> + dw_hdmi_remove(hdmi); >>> +} >>> + >>> +static int ingenic_dw_hdmi_probe(struct platform_device *pdev) >>> +{ >>> + struct dw_hdmi *hdmi; >>> + >>> + hdmi = dw_hdmi_probe(pdev, &ingenic_dw_hdmi_plat_data); >>> + if (IS_ERR(hdmi)) >>> + return PTR_ERR(hdmi); >>> + >>> + return devm_add_action_or_reset(&pdev->dev, >>> ingenic_dw_hdmi_cleanup, hdmi); >> >> I think I said it already, but in this driver you could use a >> .remove callback, there's not much point in using devm cleanups in >> such a simple setup. > > Well it was your suggestion after v8: > > https://lore.kernel.org/all/DIA33R.QE29K7RKLI2C1@crapouillou.net/ It made sense for your v8, not so much for your v15... > So we now almost go back to RFC v1 almost 2 years ago: > > https://patchwork.kernel.org/project/linux-mips/patch/2c131e1fb19e19f958a612f7186bc83f4afb0b0a.1582744379.git.hns@goldelico.com/ > > Of course there was a good reason to better handle the regulator > AND the dw_hdmi_remove() by a single mechanism. > > Now the regulator has gone and been replaced by the hdmi connector > and we can go back. > >> >> In your probe you could just: >> return PTR_ERR_OR_ZERO(hdmi); > > No, this does not work since we need to platform_set_drvdata(). > to be able to access the private struct in the remove callback. > And checking errors after platform_set_drvdata() can be done but > looks strange to me. Yeah, I guess it would look strange. Fine then. Then I guess just merge your current [6/7] with this one (and make sure it comes after your current [5/7]) and it looks mergeable to me. Cheers, -Paul > It is up to you what you prefer. > >> >>> +} >>> + >>> +static struct platform_driver ingenic_dw_hdmi_driver = { >>> + .probe = ingenic_dw_hdmi_probe, >>> + .driver = { >>> + .name = "dw-hdmi-ingenic", >>> + .of_match_table = ingenic_dw_hdmi_dt_ids, >>> + }, >>> +}; >>> +module_platform_driver(ingenic_dw_hdmi_driver); >>> + >>> +MODULE_DESCRIPTION("JZ4780 Specific DW-HDMI Driver Extension"); >>> +MODULE_LICENSE("GPL v2"); >>> +MODULE_ALIAS("platform:dwhdmi-ingenic"); >> >> Should probably be "platform:dw-hdmi-ingenic"? > > Yes, indeed. Thanks for spotting! > > Was also good in v1. Probably someone deleted the hyphen unnoticed > during editing of "jz4780" to "ingenic"...