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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9540BC433EF for ; Fri, 26 Nov 2021 04:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=m/G6oXaX/XDvxmOb37qXWzVwtxzF+y4z9MWgL6nhOVw=; b=uYJDNcOLEPfimV k/45rDdDbu9h2693h5YWQNhLYEtKaLl2D8kLRrTxe8JuNEVuBvXqrxRyroFB3ixOoxSMbvZzAgtGw k8rFM2NMlKll27zt57V8siWINiAG5sozUPzaVI5NFukIFbpOpY+Is/ynsk+emYbagJXHcCjEYGJ1C DZA+3CnataoPw/AruOoJq0GtotBXVGbZI8NY9iaKaFeJKpjwC6psHS4sqT3fU9EhLtljbumOR3l4/ j/clUf2puu6WDN3p59CglA5TwA3Kp+lgsVj8KnY+2Xagc1q5IQT0YYADFB+hQipDcvQfF5DoRDIMJ bX/f73UIdcsJ/xq93CyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqT4w-009AxU-1k; Fri, 26 Nov 2021 04:43:18 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqT4s-009Avx-9f for linux-arm-kernel@lists.infradead.org; Fri, 26 Nov 2021 04:43:16 +0000 Received: by mail-pj1-x1035.google.com with SMTP id iq11so6413904pjb.3 for ; Thu, 25 Nov 2021 20:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2LgS2eMeGMdnukM8cUoBve3IMu8b+A022tBUdPAN3OI=; b=OMrr+Nwu0J1jMehGE7uVSNYBlFIZq8YEo1TshuWAuOw8rXnVxBWCnOTWjX0tJ8xk/B p/Y59W0vsB2Wi3nvclkhheA1yJPtWLGCQz5/4tkKL1gPMOU2yaJCZLPkduIJmevR+iY3 vswhEHp1va64ULvN+IMrCNIV1d2YA61/uy2GPkHqP2FTr1PXJiPtEZ0UPZJBgLuBmyBf y8cGvCCOLzRmUZVK5fD4B7khJLpGmSqs27GzUwOIZBA8TW1UWIdSWXg5lNS+PXZKiJBG i8E2GgHrlX/vOX7yqdeWm+uof9bMapyGZc8cAcILcgUrEmOl0V9Ycq6yjJMMtFtCKdRx JRnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2LgS2eMeGMdnukM8cUoBve3IMu8b+A022tBUdPAN3OI=; b=vK55ztAvjPHFqEFjZjJpQmsldpdMLKm8ruDxXID+WU8C8oLlUPMkESLL1HnXCc0cvO FVmihKePoEBvfYUOnJq8GUlGxQ4OPIg77OJCDmrnD16EhesHMOFJX+neEZvDRKdSC1Ld nm+X6gUBrICEtT4mRAuSnLVgqY/kK+qDaWS4KfRutjO1xcFq3qjFPAQ1+EHpa93WEV4C elnKRZO+sv6Rqs+7EHlJHNlE+HeiY5aMQFgjnGif8h+D2RJ/OTLTs+wTVP6QYk1iMYdk LsFMBpun9J71nrARZkXUI78jEg2KyM06vVMR7Z86yERTo7+CHqK5QWLdOd+EA+CKTX3h e2NQ== X-Gm-Message-State: AOAM530LggtMZX53AQrAOyZht9pwC2wbdsuSASMbLoSJJevgKQmcf6R/ l+rHEi22LjBFUWQVPpRLmbsM2g== X-Google-Smtp-Source: ABdhPJzHNlb6Iu4GBBMDy3fHylI190Sir9kysQUFJV6XRqGjoRO7VKp/xNJdJgj00ozyg+MXwQzm1g== X-Received: by 2002:a17:902:7890:b0:143:c4f7:59e6 with SMTP id q16-20020a170902789000b00143c4f759e6mr36149485pll.87.1637901788687; Thu, 25 Nov 2021 20:43:08 -0800 (PST) Received: from google.com ([2401:fa00:1:10:5eda:d984:1426:91ca]) by smtp.gmail.com with ESMTPSA id o23sm4843770pfp.209.2021.11.25.20.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 20:43:08 -0800 (PST) Date: Fri, 26 Nov 2021 12:43:04 +0800 From: Tzung-Bi Shih To: "allen-kh.cheng" Cc: Jassi Brar , Rob Herring , Matthias Brugger , devicetree@vger.kernel.org, Linux-ALSA , Kai Vehmanen , Liam Girdwood , cujomalainey@google.com, linux-kernel@vger.kernel.org, Takashi Iwai , Ranjani Sridharan , Pierre-Louis Bossart , Project_Global_Chrome_Upstream_Group@mediatek.com, Mark Brown , linux-mediatek@lists.infradead.org, Daniel Baluta , linux-arm-kernel@lists.infradead.org, sound-open-firmware@alsa-project.org Subject: Re: [PATCH v4 2/3] firmware: mediatek: add adsp ipc protocol interface Message-ID: References: <20211125122925.1303-1-allen-kh.cheng@mediatek.com> <20211125122925.1303-3-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211125122925.1303-3-allen-kh.cheng@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_204314_382415_A83F230D X-CRM114-Status: GOOD ( 15.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Thu, Nov 25, 2021 at 08:29:24PM +0800, allen-kh.cheng wrote: > diff --git a/drivers/firmware/mediatek/mtk-adsp-ipc.c b/drivers/firmware/mediatek/mtk-adsp-ipc.c [...] > +static void adsp_ipc_recv(struct mbox_client *c, void *msg) > +{ > + struct mtk_adsp_chan *chan = container_of(c, struct mtk_adsp_chan, cl); > + > + if (chan->idx == MTK_ADSP_MBOX_REPLY) > + chan->ipc->ops->handle_reply(chan->ipc); > + else > + chan->ipc->ops->handle_request(chan->ipc); Using switch ... case ... makes the intention more clear. > +static int mtk_adsp_ipc_probe(struct platform_device *pdev) > +{ [...] > + for (i = 0; i < MTK_ADSP_MBOX_NUM; i++) { > + chan_name = kasprintf(GFP_KERNEL, "mbox%d", i); > + if (!chan_name) > + return -ENOMEM; It needs to go error handling path. > +static int mtk_adsp_remove(struct platform_device *pdev) > +{ > + struct mtk_adsp_chan *dsp_chan; > + struct mtk_adsp_ipc *dsp_ipc; > + int i; > + > + dsp_ipc = dev_get_drvdata(&pdev->dev); To be concise, I would prefer dev_get_drvdata() inline to the line where the variable is declared. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel