hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ata/pata_macio.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Libata based driver for Apple "macio" family of PATA controllers
34 *
....@@ -483,6 +484,8 @@
483484 struct device_node *root = of_find_node_by_path("/");
484485 const char *model = of_get_property(root, "model", NULL);
485486
487
+ of_node_put(root);
488
+
486489 if (cable && !strncmp(cable, "80-", 3)) {
487490 /* Some drives fail to detect 80c cable in PowerBook
488491 * These machine use proprietary short IDE cable
....@@ -915,6 +918,10 @@
915918 .sg_tablesize = MAX_DCMDS,
916919 /* We may not need that strict one */
917920 .dma_boundary = ATA_DMA_BOUNDARY,
921
+ /* Not sure what the real max is but we know it's less than 64K, let's
922
+ * use 64K minus 256
923
+ */
924
+ .max_segment_size = MAX_DBDMA_SEG,
918925 .slave_configure = pata_macio_slave_config,
919926 };
920927
....@@ -950,7 +957,7 @@
950957 priv->kind = controller_k2_ata6;
951958 priv->timings = pata_macio_kauai_timings;
952959 } else if (of_device_is_compatible(priv->node, "keylargo-ata")) {
953
- if (strcmp(priv->node->name, "ata-4") == 0) {
960
+ if (of_node_name_eq(priv->node, "ata-4")) {
954961 priv->kind = controller_kl_ata4;
955962 priv->timings = pata_macio_kl66_timings;
956963 } else {
....@@ -972,7 +979,7 @@
972979 priv->aapl_bus_id = bidp ? *bidp : 0;
973980
974981 /* Fixup missing Apple bus ID in case of media-bay */
975
- if (priv->mediabay && bidp == 0)
982
+ if (priv->mediabay && !bidp)
976983 priv->aapl_bus_id = 1;
977984 }
978985
....@@ -1043,11 +1050,6 @@
10431050
10441051 /* Make sure we have sane initial timings in the cache */
10451052 pata_macio_default_timings(priv);
1046
-
1047
- /* Not sure what the real max is but we know it's less than 64K, let's
1048
- * use 64K minus 256
1049
- */
1050
- dma_set_max_seg_size(priv->dev, MAX_DBDMA_SEG);
10511053
10521054 /* Allocate libata host for 1 port */
10531055 memset(&pinfo, 0, sizeof(struct ata_port_info));