From patchwork Tue Dec 29 08:43:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 353966 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp10370913jai; Tue, 29 Dec 2020 00:37:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8nisxJ1JP6NtkFcw6kcvTOT6MlBydmL0oV0/LDatoZig2iUftqWeaEbozalaNb/TZ381M X-Received: by 2002:a17:906:aac1:: with SMTP id kt1mr42792153ejb.329.1609231041472; Tue, 29 Dec 2020 00:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609231041; cv=none; d=google.com; s=arc-20160816; b=i6JIvGkEp2klcaOgmkdW0OIIsK3bFP5P4Jdi+r78HjMSmAOAsJIXXkarKPw51k1j0q Omqjt7jzpAG07IgSG/v3GpAnk2H+5ry3r47n4P1LPMWZ4wyCf+IakD2VSmHmI0/WbDsg hT+cYiKy3AmKDICtHgxAY2wr1usfvjeFgbjge8Bs37xOKo0qOO8q1/BwEIUmb90nzwYp tArs0S1aqGQtKW3W9idkk/OpNVNH4YIlak6etM5UNanRAfX1e3s4+EDyuo491N2Ie0C9 JYgCYkXLhJ08W6hMqOHtYBgG0zIxG2UgzwcmPAdClXwtw938ohokecgbgp9NjAb8uvpx PgwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=geSRvMF6kCfgAVrxKSiIze0q0V64uiyFq2IRTDk+dkk=; b=FQsp7k/osBeAhYP9nU+o3Dzh6osQ82/NBgWUm1r3Gq6qgagLUhD/RdAhh3FMJZB+18 G/l0IoBn9hg6XIGWYIhH+SFPGsBNTVN8ydPNjk/eVfWspV0uB3l3C0eZMsysXeGFaXRY V3T42gscBwV7mZ59QSWx2qxn0c7rCEcgCPBM6XRCIbufw0Iq93lUKC2nRDnT9bRrNWxK pMaiEPI/A+rj159q7hzPB5imr9b9FRCWpNLukvl4yGZIAd2cIqB5tH0uy/VdJd7xIBT5 IB64HuSeXkFfZigqPh4MItmvmIuL26TaMubceAAkg/rv3ZvvcnsUZ1PCcx3qpRpJdEqx 4szg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D6RIykqb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 p17si19506302ejw.23.2020.12.29.00.37.21; Tue, 29 Dec 2020 00:37:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=D6RIykqb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726138AbgL2IhI (ORCPT + 15 others); Tue, 29 Dec 2020 03:37:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726388AbgL2IhI (ORCPT ); Tue, 29 Dec 2020 03:37:08 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5AABC061796 for ; Tue, 29 Dec 2020 00:36:27 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id jx16so17186104ejb.10 for ; Tue, 29 Dec 2020 00:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=geSRvMF6kCfgAVrxKSiIze0q0V64uiyFq2IRTDk+dkk=; b=D6RIykqbbsTWhkZryFVxGocnOeZBVKPudNdGZj2vvHUJUpibdCgqocDJAFSK69Wn+P ymnqXLJWmCoJHZr1s5yODfIsbwEpwTdf35wOlRql8UUQ/EHkfge2GjSLXjgBLI4cAc/z w2w0N5ec5hqW3/YUt/ZIVYrPH+riYh9YtJWeh+f+uFlBG945PBhLiczUnLmEPKlulJJY lwj0R0V2ex90i06Jx7cOt3H3UF7oz5k2Dnxweced4IDyyrk9ebdnJSGyfrNF9UxskCxY NjDScanYjDP6sBg626FxAxriZaOxTqFeayKPdUECGYXEGon7UU4ZUlLe6Lg8sON6zDz1 pI0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=geSRvMF6kCfgAVrxKSiIze0q0V64uiyFq2IRTDk+dkk=; b=noxwhPtwfoPfXL2T/JTzidk1jso4VpqjtpWAlGFKU0sX0LbHO8V8t6ZZ6fPg2ROb3c MYgmrnXI+1+JyaRvcewkLlGmKV2yIP+HAD4Pu8p44Xvs9j2e2C9oCcTgY9ahoDK3UXG7 aXXf4jZf9RcUq/aafLbRbuM3zgr/znEuX3VVysVOtYL+iLjLolzkAU+i7VspwPBB2vMo RDxiAB0mXz522XGL077eWmevqH+KNvf/PVZaZepeavlbUbfF3fkuOGtKn8iuXhWz/zEp g5Hxdp6R5XRwiCQdWOQY39ptloP9suGIN2purHdohOgLZo7qycnXKhY4vBu0LrTC4MmH TmMQ== X-Gm-Message-State: AOAM530Xww7bKXQqTO6pSPvUXccHbXuiSlA//u3RXk1KLKFk1Q1uahwp AKPR9WZj8OjXvRbl7fGN5/41xA== X-Received: by 2002:a17:906:a04e:: with SMTP id bg14mr3255978ejb.149.1609230986639; Tue, 29 Dec 2020 00:36:26 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:490:8730:6f69:290a:2b46:b9]) by smtp.gmail.com with ESMTPSA id c23sm37265143eds.88.2020.12.29.00.36.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Dec 2020 00:36:26 -0800 (PST) From: Loic Poulain To: manivannan.sadhasivam@linaro.org Cc: linux-arm-msm@vger.kernel.org, bbhatt@codeaurora.org, hemantk@codeaurora.org, Loic Poulain Subject: [PATCH v6 01/10] mhi: Add mhi_controller_initialize helper Date: Tue, 29 Dec 2020 09:43:42 +0100 Message-Id: <1609231431-10048-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609231431-10048-1-git-send-email-loic.poulain@linaro.org> References: <1609231431-10048-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This function allows to initialize a mhi_controller structure. Today, it only zeroing the structure. Use this function from mhi_alloc_controller so that any further initialization can be factorized in initalize function. Signed-off-by: Loic Poulain --- drivers/bus/mhi/core/init.c | 6 ++++++ include/linux/mhi.h | 6 ++++++ 2 files changed, 12 insertions(+) -- 2.7.4 diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 96cde9c..a75ab8c 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -1021,6 +1021,12 @@ void mhi_unregister_controller(struct mhi_controller *mhi_cntrl) } EXPORT_SYMBOL_GPL(mhi_unregister_controller); +void mhi_initialize_controller(struct mhi_controller *mhi_cntrl) +{ + memset(mhi_cntrl, 0, sizeof(*mhi_cntrl)); +} +EXPORT_SYMBOL_GPL(mhi_initialize_controller); + struct mhi_controller *mhi_alloc_controller(void) { struct mhi_controller *mhi_cntrl; diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 04cf7f3..2754742 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -537,6 +537,12 @@ struct mhi_driver { #define to_mhi_device(dev) container_of(dev, struct mhi_device, dev) /** + * mhi_initialize_controller - Initialize MHI Controller structure + * @mhi_cntrl: MHI controller structure to initialize + */ +void mhi_initialize_controller(struct mhi_controller *mhi_cntrl); + +/** * mhi_alloc_controller - Allocate the MHI Controller structure * Allocate the mhi_controller structure using zero initialized memory */