From patchwork Wed Jul 13 06:54:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2123 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D1F4D3F1F7 for ; Wed, 13 Jul 2022 08:54:51 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id b15-20020a056402278f00b0043acaf76f8dsf6364888ede.21 for ; Tue, 12 Jul 2022 23:54:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657695291; cv=pass; d=google.com; s=arc-20160816; b=CG+9T7Q/RNzMpGGdendNFSBK+lIoA4A+KOHt/y3FwGgVpQkLU8XczCngQVh+4jD2lk o4xmqJTmjqdXcKvOdYMPKN3ZNa3qjLjyhzR0b+Y3yWGRZWrO0PxFMa0aMkQeLwbdR3Lq 8dDHjkhEYclyRTrczhV2Ah2T64z7oKcxWF+cPVQnTS2fnypaCExmhNv4uYtkJ1LOAGDS BJzMlvTKRAqkb98PixEqKrTRXJmqd7v5e1sPUjmyurHomjRzZKgmfi5xMpVq6kXew63/ oik2ZV1p7DAAPUIu14WgzIUDPvuW72Khh/5aD1UJ80MUPI7TMFOMUhUvab61GFywvoCY aglA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=EKhWtY7EXFQNFDk29Odq5D84TnlUf61+KpGV+2icKiQ=; b=rxOhKAgEhK/lrX80yaRbxOvFbAI9++p4jV8OOVEvOwsAt61uIjTpsUW6YGgZhmhRvM 80riduFTyREW7VluTdCCsHGfCHvxJYvCJPMXpI23PNS+/S6q6+F8Sw3iZH71VLT1QpnO 2R7a1lUJIAfIQW9Uroejv951DbC5ple5UV+k7jpMaJAV46s6e7dYnTlV7KA2bz/tyi3G CnCYuueYRGa8FAM/7D8WSCqf7GJmpmQNGG8Hu5DKGCM7iA8yXl8XVl9ZIVYvts7wTE9C eusF8Lr0g/mId2Gwb8ZlhiF/HRxZk0n1Q6/F9R6BaXYPEY73Xy/CbU8WxSoJtDuE8qvV h1GQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BYf4wsXF; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=EKhWtY7EXFQNFDk29Odq5D84TnlUf61+KpGV+2icKiQ=; b=lzxnTCvl3kgWx8mvG+wJgoK7R5uxK0C2/rtK1dX/NGmG6/M+YFfhdRTTt4tW/sx+wJ tZ5t/Pw/cH3e4Rr8BD7bWMcv2VAm4b4XVRBzkB/Y31TZpZ+vAeGa6eTR+KogAJ1AUZC7 SAWdiKPAosg5ZqsiKlp7B/NosnIIXUoDe1z+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=EKhWtY7EXFQNFDk29Odq5D84TnlUf61+KpGV+2icKiQ=; b=3mmvrZN+I1/EEmvKJxMsd4Cf+RmhbA6oPWU0bsuixnxvF1Z9SK9qMieEvbIqdQqVD5 EvWAlq0On6iSCi141TaqzjzPwysgoWrhNzF6+VV7DXAfeiSkgJhxHVHYgPADnOjkQLpc 5u4J1NETuxktE5I8LAA8L2C1mqOGB2nKl0NvjnC1tFYaXaH87XaVaqoLtjgAvgm28oAp c1x8HCN1XCuT5w6n9Wf4VJhcXpkl9xN4gm0rLCqP2xZ+HU73EHrWXMHhTdELedJ/cJlq IjYXYvgbkO5YDC6h2hccRfzvB0a3YQLSwk+0fVSo6iy68EKkTN2VLKSAzykzPYjlp2v2 uTEw== X-Gm-Message-State: AJIora8YGOw85vmy0vbLmEKS8AnK15E1aqEJ7Pp9YfzeNG+bUNSVDWfn U2NwEtCnrCG03L+uKKAF5tWGsu4C X-Google-Smtp-Source: AGRyM1v2WbLXjXPT0rlpJ0dydeSVPluvWqWheUW/3v453Nuo7BOBl1rduq9oIP6OVgIds5TOmGcrhQ== X-Received: by 2002:a05:6402:1d53:b0:43a:9ba7:315b with SMTP id dz19-20020a0564021d5300b0043a9ba7315bmr2745010edb.350.1657695291692; Tue, 12 Jul 2022 23:54:51 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:d0e:b0:43a:6e96:4ae7 with SMTP id eb14-20020a0564020d0e00b0043a6e964ae7ls151866edb.1.gmail; Tue, 12 Jul 2022 23:54:50 -0700 (PDT) X-Received: by 2002:a05:6402:13:b0:439:ffe8:bec9 with SMTP id d19-20020a056402001300b00439ffe8bec9mr2767439edu.297.1657695290414; Tue, 12 Jul 2022 23:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657695290; cv=none; d=google.com; s=arc-20160816; b=AlXz3VGn56jttjAvO23nHVFQPH2QeZCsJlAc8KsrCZiPGBv6dckGEw6CaDYwDuAnVg jeV5jPLKb51tBTVq0YPQ6N/npVL8BKHdiuNwhUOK3xMGi1Q59/rRZrO7pDGa9eplmxwO Jctogx8QXtdB1lWD954ibOExtDM5MYQKuAmgZUrt8dgi6tk7xocdtSYzhMK6Tj6B7MKk F9rpeOyXI1X/89VxwnyGVAZx57FrJ/oOnrdxTH65RiGVw9RsIUi1EiF4WOyE31ye9/oz RwHueW+M2OB84OwDsj7+uLWzQg3xKSa3WgEjYm28B5KXgVNw+JSam9Zw9dvFm8C5+/gV ctKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=R0rMlj9Mu1Gv7wJS6s/+zrStFiz/O7ov8BZ7vBQQzXI=; b=P1QmmP1TnLeZ9uqJ5cRNpAZmv5rsQYDjLTgJbRbvTg5xNQ3kdkfnjUfg5SjNLKB20c aovk3Q51pNncywWyjm34aBQOhvKt5X4etfXW3xX0PQPsOeY4CTN5N1CNu2S3SNIQvuHX tZ/ESh1gKLx81VTyyIJ7EKIkcr38Nd2f5fA013OGw4RWMWwqfO0w4ofzHzSCbJ/utX2K mBpBdbhCQz5TmCiyGxWDR9MeUmgBvMsJGnDyJMoca2s65abVVYEERMKyw7oddVRp7GSr C/LSyvL1MdR9KtrMcbd1AMQrr/+Rez3H3plw7bCXoa++fdj65Eet4w0iLbJmOuTjBgBR fssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BYf4wsXF; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id hj1-20020a170906874100b007263150e3a6sor3310225ejb.51.2022.07.12.23.54.50 for (Google Transport Security); Tue, 12 Jul 2022 23:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:3e81:b0:726:9615:d14d with SMTP id hs1-20020a1709073e8100b007269615d14dmr1861117ejc.517.1657695290120; Tue, 12 Jul 2022 23:54:50 -0700 (PDT) Received: from panicking.amarulasolutions.com ([2.198.242.86]) by smtp.gmail.com with ESMTPSA id lz21-20020a170906fb1500b0072aa38d768esm4635263ejb.64.2022.07.12.23.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 23:54:49 -0700 (PDT) From: Michael Trimarchi To: Dario Binacchi , linux-amarula@amarulasolutions.com, Tommaso Merciai Subject: [PATCH 4/4] mtd: nand: Get rid of mtd variable in function calls Date: Wed, 13 Jul 2022 08:54:39 +0200 Message-Id: <20220713065439.272149-4-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220713065439.272149-1-michael@amarulasolutions.com> References: <20220713065439.272149-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BYf4wsXF; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , chip points to mtd. Passing chip is enough to have a reference to mtd when is necessary Signed-off-by: Michael Trimarchi --- drivers/mtd/nand/raw/mxs_nand_spl.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 11 ++++++----- include/linux/mtd/rawnand.h | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c index 05886fa025..29c25f774e 100644 --- a/drivers/mtd/nand/raw/mxs_nand_spl.c +++ b/drivers/mtd/nand/raw/mxs_nand_spl.c @@ -83,7 +83,7 @@ static int mxs_flash_full_ident(struct mtd_info *mtd) struct nand_chip *chip = mtd_to_nand(mtd); struct nand_flash_dev *type; - type = nand_get_flash_type(mtd, chip, &nand_maf_id, &nand_dev_id, NULL); + type = nand_get_flash_type(chip, &nand_maf_id, &nand_dev_id, NULL); if (IS_ERR(type)) { chip->select_chip(mtd, -1); diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 02789789e9..d7537f18c7 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4152,8 +4152,9 @@ static int nand_get_bits_per_cell(u8 cellinfo) * chip. The rest of the parameters must be decoded according to generic or * manufacturer-specific "extended ID" decoding patterns. */ -static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip) +static void nand_decode_ext_id(struct nand_chip *chip) { + struct mtd_info *mtd = &chip->mtd; int extid, id_len; /* The 3rd id byte holds MLC / multichip data */ chip->bits_per_cell = nand_get_bits_per_cell(chip->id.data[2]); @@ -4291,7 +4292,7 @@ static void nand_manufacturer_detect(struct mtd_info *mtd, struct nand_chip *chi chip->manufacturer.desc->ops->detect) chip->manufacturer.desc->ops->detect(chip); else - nand_decode_ext_id(mtd, chip); + nand_decode_ext_id(chip); } /* @@ -4432,11 +4433,11 @@ static const struct nand_manufacturers *nand_get_manufacturer_desc(u8 id) /* * Get the flash and manufacturer id and lookup if the type is supported. */ -struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, - struct nand_chip *chip, +struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip, int *maf_id, int *dev_id, struct nand_flash_dev *type) { + struct mtd_info *mtd = &chip->mtd; const struct nand_manufacturers *manufacturer_desc; int busw, ret; u8 *id_data = chip->id.data; @@ -4724,7 +4725,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, nand_set_defaults(chip, chip->options & NAND_BUSWIDTH_16); /* Read the flash type */ - type = nand_get_flash_type(mtd, chip, &nand_maf_id, + type = nand_get_flash_type(chip, &nand_maf_id, &nand_dev_id, table); if (IS_ERR(type)) { diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 57fe7fb47b..d8141cb4d1 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -29,8 +29,7 @@ struct nand_flash_dev; struct device_node; /* Get the flash and manufacturer id and lookup if the type is supported. */ -struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, - struct nand_chip *chip, +struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip, int *maf_id, int *dev_id, struct nand_flash_dev *type);