From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5A21C433E6 for ; Fri, 8 Jan 2021 19:08:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B16923A9A for ; Fri, 8 Jan 2021 19:08:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B16923A9A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qz34zJBzjH+3sc3twlAgkAa3iZ9gxhBYKFZY3VxB2nA=; b=LMJQPniZVLOi0buhp7ZRfzNDs cDLXraH4Z/X63CAscQfF2XNjg36BZHuiurCiI9Dcdesis8lb2pVMOCDbKhfuPcDILQOxv3P6LNgn5 lWHrk4/+bwvGpC7rqRTxjsWaqq1BT+H3HjVLGP901Wv4Y42GFqwnzm/PDldf48XJ1m5PsGoldovhj tPxBd7uo63STDIn+HLUZzw7mK/5YAsyuRGw7LE62nmvrNNvIKGuU2N1A9wqJ9rE3Naz6/bvn0Ods0 7SSP3zDADADr3z579INGc+OOuB76mEe7nduqumuralXb/quL1Y/tUhebLOUGAIYUs3kAGRm+v80OD QQtMSq0FA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxx6b-0003Ui-MU; Fri, 08 Jan 2021 19:07:25 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxx6Y-0003U0-Vs for linux-arm-kernel@lists.infradead.org; Fri, 08 Jan 2021 19:07:24 +0000 Received: by mail-ot1-x32c.google.com with SMTP id n42so10647932ota.12 for ; Fri, 08 Jan 2021 11:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZUAethWNhH5AHx5KYoc6HZtfXoHcLGcf1uweSJlTtuQ=; b=HIYSnkY6Q7NycBEnnzZTwlknao8S/k+ofvs35eTg12dgKAGFrf4QPFQxMY6E1SIgnx v4QZHpNSykgXpIWURlxkqeUK+hK5WQe6/LeKsJ03BpDbXhaO4a17+4ebdvVbKCiei8+m JRobCWgFbKwMMrEso6/h1ZN86HrDAtZk0ChgT/gJ2CuWElTkCZXLfIclf20+pmdTLNZb DwrZOyqNMlzbEEcyV+DKY27yQ31lDOQ6h0BSDNM0/OBmo5kVHt/ka4zs2MaXzl4PjhW6 +vhP23PRPuv2xZvwZTpuEeKehk58fssuGFnMH6UurAqg/Aa2T10znWt0sirPaDukiYHv V5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZUAethWNhH5AHx5KYoc6HZtfXoHcLGcf1uweSJlTtuQ=; b=DzKumvHsL3RbtW4z19z/AaPRtBddV6dTNWzq6MJsygjgftPbrQ2hUNabfT6Ugukx6g W3fZGQXhfyAvHm6N8jntkqHbiX9u8DJXgrLlP6vJ/Qdyv9erA42teSPTq5lgTS9kEpOQ gQCbnWwQT4Ca3qjKiEQhZbkTR2tmBgWUuQ0CL3QS2KLhzCziZ6lFejzJcRkyF2z0t6cN W/Wz+c1uGAEMr69maRY0PKxjOVt1Eya7F6r0VC1iTSzDvAhw5FBsaL8DvJb9t1hZy61b L5SfB76OzX1670jowOE3cIv4b2+D+os7FinW0QixuJPGNXkVV3mZYc4QKno4FWSLaj86 z8XA== X-Gm-Message-State: AOAM531si9nfYP47Fn7tGG0x9h4h1jeABI5FhGVDKP+C/WMjiK2r7fFL heNcHWoPZyqR0W2zIbjrWDhHIw== X-Google-Smtp-Source: ABdhPJwN6edFPoEXuLXbsc15EfSSsy2/6NGLVvzgZzPWVaB9Jywig4wbVCFey3P93N2p9vvNRyHHTg== X-Received: by 2002:a9d:d6b:: with SMTP id 98mr3578384oti.227.1610132840865; Fri, 08 Jan 2021 11:07:20 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id q18sm1890780ood.35.2021.01.08.11.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 11:07:19 -0800 (PST) Date: Fri, 8 Jan 2021 13:07:17 -0600 From: Bjorn Andersson To: Robert Foss Subject: Re: [PATCH v1 04/17] media: camss: Make ISPIF subdevice optional Message-ID: References: <20210108120429.895046-1-robert.foss@linaro.org> <20210108120429.895046-5-robert.foss@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210108120429.895046-5-robert.foss@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210108_140723_384774_AC7CE5BF X-CRM114-Status: GOOD ( 24.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geert+renesas@glider.be, catalin.marinas@arm.com, agx@sigxcpu.org, todor.too@gmail.com, Laurent Pinchart , AngeloGioacchino Del Regno , will@kernel.org, Anson.Huang@nxp.com, agross@kernel.org, Andrey Konovalov , linux-media@vger.kernel.org, devicetree@vger.kernel.org, Tomasz Figa , arnd@arndb.de, linux-arm-msm@vger.kernel.org, robh+dt@kernel.org, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, Sarvesh Sridutt , max.oss.09@gmail.com, linux-kernel@vger.kernel.org, leoyang.li@nxp.com, michael@walle.cc, Azam Sadiq Pasha Kapatrala Syed , shawnguo@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri 08 Jan 06:04 CST 2021, Robert Foss wrote: > This driver supports multiple architecture versions of the Qualcomm ISP. > The CAMSS architecure which this driver is name after, and with the > introduction of this series, the Titan architecture. > > The ISPIF is IP-block that is only present in the CAMSS architecture. "is an IP-block" > In order to support the Titan architecture, make the ISPIF an optional > subdevice. > > Signed-off-by: Robert Foss > --- > .../media/platform/qcom/camss/camss-ispif.c | 144 ++++++++++-------- > .../media/platform/qcom/camss/camss-ispif.h | 3 +- > drivers/media/platform/qcom/camss/camss.c | 113 +++++++++----- > drivers/media/platform/qcom/camss/camss.h | 2 +- > 4 files changed, 160 insertions(+), 102 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c [..] > -int msm_ispif_subdev_init(struct ispif_device *ispif, > +int msm_ispif_subdev_init(struct camss *camss, > const struct resources_ispif *res) > { > - struct device *dev = to_device(ispif); > - struct platform_device *pdev = to_platform_device(dev); > + struct ispif_device *ispif = camss->ispif; > + struct platform_device *pdev = to_platform_device(camss->dev); It seems like several of the changes in this function is replacing dev with camss->dev. If you retained a struct device *dev = camss->dev; you would avoid this. > struct resource *r; > int i; > int ret; > > + if (res == NULL && ispif == NULL) Afaict this function is called conditional on camss->ispif != NULL, and I don't see anything that would cause res to becomes NULL if is hasn't been before this change. So I think this check is unnecessary? > + return 0; > + > + ispif->camss = camss; > + > /* Number of ISPIF lines - same as number of CSID hardware modules */ > - if (to_camss(ispif)->version == CAMSS_8x16) > + if (camss->version == CAMSS_8x16) > ispif->line_num = 2; > - else if (to_camss(ispif)->version == CAMSS_8x96 || > - to_camss(ispif)->version == CAMSS_660) > + else if (camss->version == CAMSS_8x96 || > + camss->version == CAMSS_660) > ispif->line_num = 4; > else > return -EINVAL; > > - ispif->line = devm_kcalloc(dev, ispif->line_num, sizeof(*ispif->line), > - GFP_KERNEL); > + ispif->line = devm_kcalloc(camss->dev, ispif->line_num, > + sizeof(*ispif->line), GFP_KERNEL); > if (!ispif->line) > return -ENOMEM; > [..] > @@ -1393,6 +1410,9 @@ void msm_ispif_unregister_entities(struct ispif_device *ispif) > { > int i; > > + if (!ispif) > + return; I like this, but later in the patch you make the calls to this function conditional on ispif != NULL. You should only need one of the checks. Regards, Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel