Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27465269rwd; Tue, 4 Jul 2023 03:25:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmVhRI1ZUEoCCDDfvnVCuzo7fZ+svoeZJ2oNhmRPZLOAbSQ9epetjgGUGD6GZzbzCgxg0X X-Received: by 2002:a05:6358:1b:b0:135:b4c:a490 with SMTP id 27-20020a056358001b00b001350b4ca490mr4050722rww.10.1688466330240; Tue, 04 Jul 2023 03:25:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688466330; cv=pass; d=google.com; s=arc-20160816; b=Rs1d2g2GsdP5d6O1sCwT1/MUssORqFSezPqZGcdqVRX8ckc9EtKITkDJa9Te33MqjT TeCd7MRDoG/9B70IxssnAaaDIwMbGx9+pfG9ysAGStF8M+UKfmcKF7bNXdvejQyRxhAv Gg1b0kz82DkfiYnbdM0U2zwGKu9ptEtY0pDLNDe2nvgaJJGlGTfXCtu2VbL/zvLDNqNP zK3pnEhVKwZFgVdkUR0gUZVz28uxTsAgPbGth/OOEDSpwCxd2RVKABM2YCYqtGl/WYXc mxbuXHX5d8+MbGH/D9Ergp81hVlLB35nQp4YGLvkwCgHyGgY3dJ1F0gFPcQMKKb2dwD8 GVfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; fh=Qcyam3eU2gGYjWgLmWnXwIH5Hk7gZDbNVaVgm4L3EtY=; b=LF6J52llg6C7tcFq8+TGsnc/28nRnqHxa5m0WUl3kpP6DDB4MrKyXJE7KGRULIUBsT DIcEvoeCvsRAdr1OEZe71FlAXCiVneZdqHRDOIh0b5976kDt8+PvvUn0y3f+cDumBZK/ i+TGbL8X3a63LfRkMXqmzIueptp3uVQwmRhe89riSuvDwdFDZkxEdkK0joSLM/hGuR4E 4xtBQZAjuhUyGYqobbZkJw5iPg5kvmXLped2ecBiW1pvtZxTnE3oLvUAFDwWnIkWnDQc SLG6m6SD0zX13Fu574da6iceusa9kHN7OBnMhprf/YwxzD7UF3zeUC2ikXQ1gZjZigdL 74/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=REaVaGME; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p41-20020a056a000a2900b00661cd40bd67si19172925pfh.314.2023.07.04.03.25.15; Tue, 04 Jul 2023 03:25:30 -0700 (PDT) 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; dkim=pass header.i=@vivo.com header.s=selector2 header.b=REaVaGME; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjGDJsE (ORCPT + 99 others); Tue, 4 Jul 2023 05:48:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjGDJsC (ORCPT ); Tue, 4 Jul 2023 05:48:02 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09898B5; Tue, 4 Jul 2023 02:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSXDz5n1T5E5DfbR1nmsFQFfkp1K/rs1+Jpjfck0X4ZmMdpTq+KIOH9osEd9objFDsed74IbDcCSV2aar8rv+4fkScUlbyOEPpookZsL3sFwVAkUUgFwa0a1/JzUaxmaoUhxWf0UPhzk9lqzmn9L/0QyFSYUuCh2n7jAFNUsGd4bl2wPFazwk/QyOHgRHB/J2r3Ll+uFjN35gp4Usj5BAXx+EtntAwu2QQxmb4qpai5vdQ4r2ScyqfAq2JK2tT8Eb6/UbKdusQuhQ96CIZMWX+7A9B2kdA9KlNsHsAIsCP57dHYYhNdppb3nB1twVan0OhWTt0ym5tkESxuWrIFAfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=dOyd29o7/7HesSyo8ZnwleujANleMv82dcznKHtuUqWPqrIu/8DwpQBEoEGwj+drjbUf+ShRWAtFIzDh9b7IekAmW+NRDLs10f+mfjIKFVMZDisE3aVOUb5mj2ze+gu1bJ5Hs0mqeoe/NKlBYE+UryB4NvpjZvsm1HWL6KXcYYYis0X/84B0nWHJl5mpPQUsZRF4vR6xTZq2B/BeJQJXzd86kHNhawr/CbfRsVB9+P9g6x9bnkEJBncPqJslIYfBkzmR7QpTXpHz380KkgCWhg8tHavL9hEY+5brxFwwiO38amI1wEbLsEgVV7XM69q8V2UMAHGUx6PIxOU0opT7sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=REaVaGMEYY2NiMB8J9PCRcsCybjVPduWL49ick6nktykJNBgs/ZRtZruJ5kmR2YXLFy3TG40pAI5erweYnfpMV8mysmrToO17ZB0X/O9yuicmlQymgcuv1X5LEh4VnWHjxeEFAVOp+QP0cHkOpYS2tGE/WPr9XuJkirf8rhJlrN2Un2nmvmyWjAYlq5csZEva+b7u+7oDzQwGgULS2kABI30i4uiXou+O/jBd8LQ+RaDUFdd/Z1ghJ+wPLFPKkn0dbAbj9wUV1xV8tQJascJzMn4xgbqpglCMf2CVtyMAg63G9cTSuP8yeGl1LkFZ2uFtRjHrv4gCJ6gXG2kFFbaTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYSPR06MB6768.apcprd06.prod.outlook.com (2603:1096:400:475::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 09:47:57 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 09:47:56 +0000 From: Yangtao Li To: Pavel Machek , Lee Jones Cc: Yangtao Li , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] leds: ip30: Convert to devm_platform_ioremap_resource() Date: Tue, 4 Jul 2023 17:47:45 +0800 Message-Id: <20230704094745.25665-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0046.apcprd02.prod.outlook.com (2603:1096:4:1f5::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYSPR06MB6768:EE_ X-MS-Office365-Filtering-Correlation-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HaRPRDIe55UkZVtgK0l2ieVPIWyWn9Y3xC5mrv7sK/6zu248abELvnx/7pCLQCLs5UvdRbbSz8TW43dYe+gmPDMvCaWXVZreoJNyEKZMuLfCiKZnbir0fWQ34dEdE7xIUcVeCTp6h21tynQsQNcP59P5Y/vmLG6XGNNcuM+QJ1h0yey186isGC1yr/AulmYNXR97pFXYOGGK65BfOLEI1n1osh/dSFp+LvrIXnFh4KSv1Db28ZhCYlBjt5Y//EnUTdxdrIHMsg4MX6XsFFHu3VQ0gnwgOewhCUa9MThCXhwtmKNrsHKLxEtkwfVMm3lo3MoOk7pI8sqT4oBXl92YtTIKOc4x1PEGS3UWK75uvvscbkTFlp0B2X1DYDrWrkrJKTrwuKWkHuVziiyt237uCbd4K1vzEQqHmDmytYVwTHACqNn5cur8HslOa3cqzbfZ/J7cfq/+yNZii9iEvMOLtiLnaMc0Vu+a/6/8ydzEYp72vuSUy3UdiNQwR8shOmhMzPkrLcLBFW/RxBcfRRnCBEaff886QDai4tZqeExDa1LeH1XG0PmvJt/9NdKxgOlgthxyQ9UZGS/Dyb+3xWWOVwpISQ+fN9jgS5VFDkAax4Zp16zPqpwy+0t8K1SDlo3I X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(66556008)(86362001)(186003)(26005)(6512007)(66476007)(1076003)(6506007)(83380400001)(2616005)(4744005)(2906002)(6486002)(38100700002)(6666004)(52116002)(38350700002)(5660300002)(478600001)(8676002)(110136005)(8936002)(41300700001)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2zvU3lxtI++qMhW80Fu5IKHSDQfgpSh+qG4yV8OTREyxFLXRPCWk/FAAa9SF?= =?us-ascii?Q?u9SPUlgr0wl45lzDSz6Djnwoeg++xma/B2pAwQg5etxSIfGC6NL5JeG9s8Op?= =?us-ascii?Q?RkHZgLmnJSKW1nFhcjEdAl1nu9eD8S5f5oGN63FIcSObf0v1xzyitTlUIrAG?= =?us-ascii?Q?B9YsryU/dXllWrujTFlx8hbA6HzmvCrdjJvbVfPbWmHkGw3M3WpawaAEI0HG?= =?us-ascii?Q?Suae14QBGKTbI5w9ZyHqDq2ZIxQSsskHIX1SRKfpNFS/Fy6tk23foPwXpgTo?= =?us-ascii?Q?aCg0FZjohaFiL+ZQ90UiAu+5CQ86Tf9wGYGYOsAvFj4Hr7ZG6KpcvBHeF4XD?= =?us-ascii?Q?vKVuCZFZstXbddWNYzW+n31J93nrJBYvinHePB8heYtz5lI6M3OrWFVgteHj?= =?us-ascii?Q?GtTwNEJvu+/NfdzsESNi5Twj71Vk6lVTXnUCf5FxpJlbWuIe4GCm7IWdaIKw?= =?us-ascii?Q?d4+YClVrKeqpeZmbwY+ekoToFK+zArqz4zP40RXS+Bpmsi8O/1o13oMJDWgd?= =?us-ascii?Q?/HrQ6k6wiD2SYCe1vu9du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=?us-ascii?Q?5KffmHK33LIsua7sTMf+ecOMMJtnB/C/iQUIZzdidYzk+U38VjfcE5VCSrg2?= =?us-ascii?Q?1UgoI6IPbskNzKccuUuBPWITs4wmoXQqWhSVXjF9aYK+1ADs8yd/WajRpedL?= =?us-ascii?Q?5Gm83JYXOzOMwLi5IRuMFc/vp/vcgt+SgW263IyX?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:47:56.9060 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iX2N6JpLT1Ucdeo0ys0u+x9EW5xdFWUkzWf6HB8VrVOXnUDYg5yWuh8rdgHlngXNr6fxaTANo4zSYSToM2Crkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6768 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/leds/leds-ip30.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/leds/leds-ip30.c b/drivers/leds/leds-ip30.c index 1f952bad0fe8..2df24c303366 100644 --- a/drivers/leds/leds-ip30.c +++ b/drivers/leds/leds-ip30.c @@ -27,22 +27,16 @@ static void ip30led_set(struct led_classdev *led_cdev, static int ip30led_create(struct platform_device *pdev, int num) { - struct resource *res; struct ip30_led *data; - res = platform_get_resource(pdev, IORESOURCE_MEM, num); - if (!res) - return -EBUSY; - data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->reg = devm_ioremap_resource(&pdev->dev, res); + data->reg = devm_platform_ioremap_resource(pdev, num); if (IS_ERR(data->reg)) return PTR_ERR(data->reg); - switch (num) { case IP30_LED_SYSTEM: data->cdev.name = "white:power"; -- 2.39.0